title: T-SQL: INSERT original value in OUTPUT clause
body: <p>I have a table <em>Items (ItemID, Name, ...)</em> where <em>ItemID</em> is auto-generated identity</p>
  
  <p>I want to add rows into this table FROM select on this same table.
  AND save into table variable the references between OriginalItemID and NewlyGeneratedID.</p>
  
  <p>So I want it to look like the following:</p>
  
  <pre><code>DECLARE @ID2ID TABLE (OldItemID INT, NewItemID INT);
  
  INSERT INTO Items OUTPUT Items.ItemID, INSERTED.ItemID INTO @ID2ID
  SELECT * FROM Items WHERE Name = 'Cat';
  </code></pre>
  
  <p>BUT <code>Items.ItemID</code> obviously does not work here. Is there a workaround to make OUTPUT take original ItemID from the SELECT statement?</p>