title: Where Statement from declared variable Sql Server
body: <p>it's possible to pass a Where statement through declared variable in SQL Server 2008?, How can I do something like this?</p>
  
  <pre><code>declare @foo as nvarchar(max) = '9510,9580,5030'
  SELECT T1.[ItemCode]
  FROM tbl1 T1
  WHERE T1.ItemCode in (@foo)
  </code></pre>
  
  <p>When I run this code my foo variable can hold at least one item or 100 items, that depends on another result</p>