Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DO CASE equavalent in Transact-SQL
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01326640
Message ID:
01326682
Vues:
17
This message has been marked as a message which has helped to the initial question of the thread.
>>What's wrong with one SP. You always can use structure like this:
>>
>>IF @Something1
>>   BEGIN
>>   -- Select 1
>>   END
>>ELSE IF @Something2
>>   BEGIN
>>   -- Select 2
>>   END
>>ELSE IF @Something3
>>   BEGIN
>>   -- Select 3
>>   END
>>
>
>That's exactly what I'm writing at the moment but I didn't know what it should be ELSE IF.
>
>BTW, I think I don't need BEGIN/END if I only have just one select command, am I right?
>
>And I have another SQL question regarding projection. For some reason the code my colleague tried didn't work for me with the strange error.

You don't need it, but what if you return to that code after a while and try to add an additional code in the first IF?
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform