Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Case in Where clause
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2000
Miscellaneous
Thread ID:
01303803
Message ID:
01303829
Views:
15
>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--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform