テーブルを作成しました
create table AA(
id int ,
name varchar(20),
sname varchar(20)
)
今、私は新しい値を挿入し、挿入された行IDを取得しています:
declare @InsID table (InId int)
insert into AA (name, sname)select 1, 'John', 'Rock'
output inserted.id into @output
Select * from @InsID
しかし、それは私にエラーを示しています: Msg 102, Level 15, State 1, Line 3 Incorrect syntax near 'inserted'. 何が問題と思われるか知っている人はいますか?