Information générale
Forum:
Microsoft SQL Server
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
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement