I have created table
create table AA(
id int ,
name varchar(20),
sname varchar(20)
)
Now I am inserting a new value and getting the inserted rows id:
declare @InsID table (InId int)
insert into AA (name, sname)select 1, 'John', 'Rock'
output inserted.id into @output
Select * from @InsID
But it shows me error: Msg 102, Level 15, State 1, Line 3
Incorrect syntax near ‘inserted’. Does anyone know what seems to be the problem?
1 Answer