BEGIN
SET NOCOUNT ON;
/* Here declare a Table Variable */
DECLARE @Table_Var TABLE(itemID INT)
INSERT INTO Table1(colA,colB,colC)
OUTPUT inserted.itemID INTO @Table_Var(itemID)
SELECT @colA,@colB,@colC
/* Now do the insert into Table 2*/
INSERT INTO TABLE2
SELECT itemID FROM @Table_Var
END
SCOPE_IDENTITY()
is only good when you are doing a single Insert, and it is an IDENTITY column whos value you want to capture. It will only return the last Generated Identity value.
Other then that if you are doing multiple insert or it isn't an identity column then you should use OUTPUT
clause along with a table variable/temp table to capture the inserted values. and then do whatever you want to do with them values later on (insert in another table/logging whatever).
To learn more about OUTPUT Clause
have a look at this link.