declare @d varchar
set @d = 'No filter'
if (@d like 'No filter')
BEGIN
select 'matched'
end
else
begin
select 'not matched'
end
the result of above is always not matched can anybody tell me why and how can I use the like or ‘=’ result in my stored procedure.
thanks
Change your declaration to
Then
will work.
Please remember that LIKE is used for pattern matching,
something like
So in your case you might want to change the code to
with an “=”