ms sql use like statement result in if statement

Posted by Asha on Stack Overflow See other posts from Stack Overflow or by Asha
Published on 2010-04-08T15:54:55Z Indexed on 2010/04/08 16:03 UTC
Read the original article Hit count: 668

Filed under:
|
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

© Stack Overflow or respective owner

Related posts about sql

Related posts about sql-server