返回刚插入记录的ID :
SELECT @@IDENTITY
sql output 更新记录时得到更新记录的ID值
DECLARE @TMP TABLE(ID INT) update tt set name = 'asder' OUTPUT DELETED.hid INTO @TMP where lid=3 SELECT ID FROM @TMP; --SELECT @@IDENTITY