Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Case in Where clause
Message
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Case in Where clause
Environment versions
SQL Server:
SQL Server 2000
Miscellaneous
Thread ID:
01303803
Message ID:
01303803
Views:
60
Hi all, is it possible to use a Case statement in a Where clause ?, what I am trying to do , is , update a table using either field1 = somevalue or field2 = someothervalue depending on a flag setting
pseudo babble

update mytable
set fieldx = null
Where
If @MyFlag = 'Y'
field1 = somevalue
else
field2 = someothervalue
hope that makes sense
Regards,
Peter J. Kane



Pete
Next
Reply
Map
View

Click here to load this message in the networking platform