title: what does the select @p1 do in the prepared statement
body: <p>I have an ms sql trace that shows the following...  what does the select @P1 mean or do?</p>
  
  <p>The Trace shows this</p>
  
  <pre><code>declare @P1 intCHAR(10)set @P1=29CHAR(10)
  
  exec sp_prepexecrpc @P1 output, N'gsp_DeleteAccessForAreaGroupByCardholder', 0, 1117687CHAR(10)
  
  select @P1
  </code></pre>
  
  <p>why does it end the event with a select @p1 if it is not doing anything with it?  Several of the events in the sql profiler end in select @p1  or select @p1, @P3, @P4  what is it doing with these values?</p>