我已經創建表入門插入的行ID
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
但它爲我的錯誤:消息102,15級,狀態1,行3 「插入」附近的語法不正確。有誰知道似乎是什麼問題?
感謝的例子見here,這正是我需要的 – Brezhnews 2012-04-25 10:34:59