Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Case in a where?
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
01044413
Message ID:
01044426
Views:
18
You didn't specify what you're comparing @notplinid to
	when @notplinid = ??? then
BTW, dynamic SQL could be faster in some case than query with convoluted WHERE clause because execution plan created by query analyzer with one condition could be totaly wrong for another condition.

>I'm having some problems getting this query to work, based on a condition I want to set the where clause, but it keeps on telling me I have a syntax error near "like" I dont see any error, cant seem to figure this one out. I know I can do this with some dynamic SQL but I really dont want to do that because of speed concerns.
>
>WHERE
>case
> when @notplinid = then (plinid like @plinid+'%' or @plinid = '')
> else (plinid not like (@plinid+'%'))
>end
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform