title: Updating multiple rows using list of Ids
body: <p>I need to update multiple rows in the table on the basis of Ids. In the stored procedure, I'm creating a varchar variable that holds the Ids list. </p>
  
  <p>Now, in the table I have entries with Ids 1, 2. The varchar variable has value <code>1,2</code>; so I'm expecting no row to be updated with following query.</p>
  
  <pre><code>UPDATE mytbl
  SET flag = 1
  WHERE Id IN (IdList); -- Here IdList has value '1,2'
  </code></pre>
  
  <p>But here row with Id as <code>2</code> is getting updated. Select query also returns the same row. 
  I tried concatenating <code>IdList</code> as <code>"'1','2'"</code>, then it retuens both the rows (with Ids 1 and 2).
  The data type of <code>Id</code> is <code>int</code>. Is there proper way to maintain integer list?</p>