@@IDENTITY vs SCOPE_IDENTITY() vs IDENT_CURRENT [sql server 2005]

这一生的挚爱 提交于 2019-12-02 07:15:40

I'm not entirely sure what these "knows bugs" in SCOPE_IDENTITY() should be. The only thing I'm currently aware of is here: Six reasons you should be nervous about parallelism mentioned as the very first point.

Triggers

Using @@identity is reliant on the fact that there are no triggers in your database creating records elsewhere.

If you create a record but a trigger then creates a log entry for the creation, @@identity will return you the id of the log entry in the log table.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!