Is there any "simple" way to do this or I need to pass by a table variable with the "OUTPUT ... INTO" syntax?
DECLARE @someInt int
INSERT INTO MyTable2(AIntColumn)
OUTPUT @SomeInt = Inserted.AIntColumn
VALUES(12)
Is there any "simple" way to do this or I need to pass by a table variable with the "OUTPUT ... INTO" syntax?
DECLARE @someInt int
INSERT INTO MyTable2(AIntColumn)
OUTPUT @SomeInt = Inserted.AIntColumn
VALUES(12)
You need a table variable and it can be this simple.
Over a year later... if what you need is get the auto generated id of a table, you can just
Otherwise, it seems like you are stuck with using a table.