Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Case in Where clause
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2000
Divers
Thread ID:
01303803
Message ID:
01303829
Vues:
14
>Hi Sergey, I have it sussed now, this is what I have
>
>
>@MyFlag = 'Y'
>
>update mytable
>set field1 = null
>where @MyFlag = 'Y' And MasterCustomerRef = @MasterCustomerRef
>Or @MyFlag = 'N' And CustomerRef = @CustomerRef
>
>
>
>maybe not pretty but it works
>

As I said, I'm not sure why it ahs to be one update. Also, when you combine OR and AND it's better to use parenthesis
where (@MyFlag = 'Y' And MasterCustomerRef = @MasterCustomerRef)
Or (@MyFlag <> 'Y' And CustomerRef = @CustomerRef)
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform