title: help with TSQL IN statement with int
body: <p>I am trying to create the following select statement in a stored proc</p>
  
  <pre><code>@dealerids nvarchar(256)
  
  SELECT * 
  FROM INVOICES as I
  WHERE convert(nvarchar(20), I.DealerID) in (@dealerids)
  </code></pre>
  
  <p>I.DealerID is an INT in the table. and the Parameter for dealerids would be formatted such as
  (8820, 8891, 8834)</p>
  
  <p>When I run this with parameters provided I get no rows back. I know these dealerIDs should provided rows as if I do it individually I get back what I expect.
  I think I am doing </p>
  
  <pre><code>   WHERE convert(nvarchar(20), I.DealerID) in (@dealerids)
  </code></pre>
  
  <p>incorrectly. Can anyone point out what I am doing wrong here?</p>