MSSQLserver 操作返回ID方法

1.添加语句 insert into 时:

在语句最后加上;select @@IDENTITY; 可返回当前添加记录的ID

2.做修改语update时:

在语句后面 where前加上output inserted.ID 可返回当前修改的记录ID

原文地址:https://www.cnblogs.com/zhaoqiangxiaoxiao/p/3518598.html