Brug tabelvariabel for at få id
DECLARE @id int
DECLARE @table table (id int)
INSERT INTO MyTable(name)
OUTPUT inserted.id into @table
VALUES('XYZ')
SELECT @id = id from @table
Brug tabelvariabel for at få id
DECLARE @id int
DECLARE @table table (id int)
INSERT INTO MyTable(name)
OUTPUT inserted.id into @table
VALUES('XYZ')
SELECT @id = id from @table