返回刚插入记录的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
Powered by: 博客园 Copyright © 2024 且行且思 Powered by .NET 9.0 on Kubernetes