Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Case in a where?
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
01044413
Message ID:
01044426
Vues:
17
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--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform