Click here to Skip to main content
15,900,108 members
Home / Discussions / Database
   

Database

 
GeneralRe: Searching with optional parameters Pin
S Douglas20-Aug-11 7:53
professionalS Douglas20-Aug-11 7:53 
GeneralRe: Searching with optional parameters Pin
PIEBALDconsult20-Aug-11 13:01
mvePIEBALDconsult20-Aug-11 13:01 
QuestionRe: Searching with optional parameters Pin
Shameel16-Aug-11 4:52
professionalShameel16-Aug-11 4:52 
AnswerRe: Searching with optional parameters Pin
Pascal Ganaye16-Aug-11 6:02
Pascal Ganaye16-Aug-11 6:02 
GeneralRe: Searching with optional parameters Pin
PIEBALDconsult16-Aug-11 18:04
mvePIEBALDconsult16-Aug-11 18:04 
QuestionSQL bit to bool conversion [moved] Pin
5fingers16-Aug-11 0:37
5fingers16-Aug-11 0:37 
GeneralRe: SQL bit to bool conversion PinPopular
Nagy Vilmos16-Aug-11 0:39
professionalNagy Vilmos16-Aug-11 0:39 
GeneralRe: SQL bit to bool conversion Pin
Shameel16-Aug-11 4:53
professionalShameel16-Aug-11 4:53 
GeneralRe: SQL bit to bool conversion Pin
5fingers17-Aug-11 0:59
5fingers17-Aug-11 0:59 
GeneralRe: SQL bit to bool conversion Pin
Dalek Dave16-Aug-11 0:39
professionalDalek Dave16-Aug-11 0:39 
GeneralRe: SQL bit to bool conversion Pin
5fingers17-Aug-11 0:57
5fingers17-Aug-11 0:57 
GeneralRe: SQL bit to bool conversion Pin
chriselst16-Aug-11 0:40
chriselst16-Aug-11 0:40 
GeneralRe: SQL bit to bool conversion Pin
CPallini16-Aug-11 0:45
mveCPallini16-Aug-11 0:45 
GeneralRe: SQL bit to bool conversion PinPopular
PompeyBoy316-Aug-11 0:45
PompeyBoy316-Aug-11 0:45 
GeneralRe: SQL bit to bool conversion Pin
Richard MacCutchan16-Aug-11 1:15
mveRichard MacCutchan16-Aug-11 1:15 
GeneralRe: SQL bit to bool conversion Pin
5fingers17-Aug-11 0:56
5fingers17-Aug-11 0:56 
GeneralRe: SQL bit to bool conversion Pin
Richard MacCutchan17-Aug-11 1:27
mveRichard MacCutchan17-Aug-11 1:27 
GeneralRe: SQL bit to bool conversion Pin
Smithers-Jones16-Aug-11 1:03
Smithers-Jones16-Aug-11 1:03 
GeneralRe: SQL bit to bool conversion Pin
5fingers17-Aug-11 0:56
5fingers17-Aug-11 0:56 
QuestionLocal Variable Ntext Probelm sql 2005 Pin
md_refay14-Aug-11 1:10
md_refay14-Aug-11 1:10 
Answercross-post Pin
Wendelius14-Aug-11 1:45
mentorWendelius14-Aug-11 1:45 
QuestionCheck Different Select query result Pin
Naunt11-Aug-11 18:17
Naunt11-Aug-11 18:17 
Dear all,
Please suggest me to write shortest and effective query in Storeprocedure.
To assign value to @Color, there will be different select queries with different conditions, My query sample will be as the following,

SQL
Select @result=count(*) from table where condition1
IF @result = 20
    Begin
        @Color='Red Color'
    End
Else
    Begin
        select @result=count(*) from table where condition2
        IF @result=20
        Begin
            @Color='Blue Color'
        End
        Else
        Begin
            select @result=count(*) from table where condition3
            IF @result>0
            Begin
                @Color='Blue Color'
            End
            Else
            Begin
                Select  @result=count(*) from table where Condition4
                IF @result>0
                Begin
                    @Color='Blue Color'
                End
                Else
                Begin
                    Select @result=count(*) from where Condition5
                    IF @result=20
                    Begin
                        @Color='Green Color'
                    End
                    Else
                    Begin
                        Select @result=count(*) from where Condition6
                        IF @result>0
                        Begin
                            @Color='Yellow Color'
                        End
                        Else
                        Begin
                            @Color='Orange Color'
                        End
                    End
                End
            End
        End
    End




Thanks and best regards
AnswerRe: Check Different Select query result Pin
Mycroft Holmes11-Aug-11 19:59
professionalMycroft Holmes11-Aug-11 19:59 
GeneralRe: Check Different Select query result Pin
Naunt11-Aug-11 21:55
Naunt11-Aug-11 21:55 
GeneralRe: Check Different Select query result Pin
Mycroft Holmes11-Aug-11 22:54
professionalMycroft Holmes11-Aug-11 22:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.