title: SQL Server delete trigger returns select statement, how to capture that data?
body: <p>On a table, there's a delete trigger that performs some operations and then at the end, executes a select statement, so when you do something like...</p>
  
  <pre><code>delete from mytable where id=1
  </code></pre>
  
  <p>it returns a recordset.</p>
  
  <p>Is there a way to save the results of that recordset into a temp table or something? I tried something like this:</p>
  
  <pre><code>declare @temptable table (returnvalue int);
  insert into @temptable (returnvalue)
  delete from mytable where id=1;
  </code></pre>
  
  <p>But apparently that syntax doesn't work.</p>