title: Conversion failed when converting the varchar value to data type int using in clause in SQL Server
body: <p>My Stored procedure is giving error </p>
  
  <blockquote>
    <p>"Conversion failed when converting the varchar value to data type int". </p>
  </blockquote>
  
  <p>What I am trying to do is to use the <code>IN</code> clause, the values inside the <code>IN</code> clause are string here and separated by comma. The stored procedure is -</p>
  
  <pre><code>ALTER PROCEDURE [dbo].[sp_UpdateBulkPageStatus] 
  @Id Varchar(50),
  @Status bit
  AS             
  BEGIN
      UPDATE Page SET Status=@Status WHERE Id in (@id)    
  END
  </code></pre>
  
  <p>It given error on running - <code>[dbo].[sp_UpdateBulkPageStatus]  '24,25',1</code> 
  Now when I am just running the update query with values on it {<code>UPDATE Page SET Status=1 WHERE Id in (24,25)</code>} then it runs perfectly. 
  What is the problem?</p>