title: ms sql use like statement result in if statement
body: <pre><code>declare @d varchar
  set @d = 'No filter'
  
  if (@d like 'No filter')
    BEGIN
      select 'matched'
    end
  else
    begin
      select 'not matched'
    end
  </code></pre>
  
  <p>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</p>