Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我如何在 TSQL 中做到这一点?:如何同时 UPDATE 和 SELECT
链接问题中答案的 TSQL 等效项类似于
UPDATE [table] SET foo=1 OUTPUT INSERTED.*, DELETED.* WHERE boo=2
在更新语句中,您可以使用INSERTED获取“之后”值和DELETED“之前”值。
INSERTED
DELETED
您正在寻找该OUTPUT子句。
OUTPUT