Use la variable de la tabla para obtener la identificación
DECLARE @id int
DECLARE @table table (id int)
INSERT INTO MyTable(name)
OUTPUT inserted.id into @table
VALUES('XYZ')
SELECT @id = id from @table
Use la variable de la tabla para obtener la identificación
DECLARE @id int
DECLARE @table table (id int)
INSERT INTO MyTable(name)
OUTPUT inserted.id into @table
VALUES('XYZ')
SELECT @id = id from @table