Gunakan variabel tabel untuk mendapatkan 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
Gunakan variabel tabel untuk mendapatkan 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