title: Can I use LIKE with an SQL variable?
body: <p>I have a query which looks something like:</p>
  
  <pre><code>select * from Table1 where name like '%ASD%'
  </code></pre>
  
  <p>I want to change it so that I can do something of this sort:</p>
  
  <pre><code>declare @name1 varchar(255)
  select @name1 = 'dfg'
  select * from Table1 where name like @name1
  </code></pre>
  
  <p>How should I achieve that?</p>