title: Using "exec" to Update a Table
body: <p>I have a temp table named as <code>#temp</code> with 2 columns: </p>
  
  <pre><code>clientID (varchar), 
  result (int)
  </code></pre>
  
  <p>I just want to loop in it and check the clientID with a stored procedure which takes 2 varchar parameters and returns 0 or 1.</p>
  
  <p>I coded: </p>
  
  <pre><code>update #temp set result=exec sp_x 'clientID' '@clientID'
  </code></pre>
  
  <p><code>clientID</code> is the column name of <code>#temp</code>.<br/>
  <code>@clientID</code> comes from parameter of the main SP</p>
  
  <p>It comes up with a warning:  </p>
  
  <blockquote>
    <p>Incorrect syntax near the keyword 'exec'.</p>
  </blockquote>
  
  <p>So, what to do?</p>
  
  <p>Thanks in advance...</p>