title: Must declare the scalar variable "@id"
body: <p>I know this question has been asked like a thousandth time. But the solutions given do not work for me.
  I have a very simple stored procedure like below:</p>
  
  <p><code>alter procedure sp_updateVacancyWithRecruitment
  (@id int,
  @idList varchar(100)
  )
  as
  EXEC('update Vacancy_team1 set recruitment_request_id=@id where id IN ('+@idList +')')</code></p>
  
  <p>And even the following doesn't work :</p>
  
  <p><code>exec sp_updateVacancyWithRecruitment @id=5,@idList='6,8'</code></p>
  
  <p>What am I doing wrong?</p>