@@IDENTITY, SCOPE_IDENTITY, and IDENT_CURRENT
2015-03-02 14:44
357 查看
@@IDENTITY, SCOPE_IDENTITY 和 IDENT_CURRENT都返回表的IDENTITY列的最后一个插入的值。
@@IDENTITY and SCOPE_IDENTITY return the last identity value generated in any table in the current session. However, SCOPE_IDENTITY returns the value only within the current scope; @@IDENTITY is not limited to a specific scope.
IDENT_CURRENT is not limited by scope and session; it is limited to a specified table.
https://msdn.microsoft.com/en-us/library/ms187342.aspx
@@IDENTITY and SCOPE_IDENTITY return the last identity value generated in any table in the current session. However, SCOPE_IDENTITY returns the value only within the current scope; @@IDENTITY is not limited to a specific scope.
IDENT_CURRENT is not limited by scope and session; it is limited to a specified table.
https://msdn.microsoft.com/en-us/library/ms187342.aspx
相关文章推荐
- Difference between SCOPE_IDENTITY(), @@IDENTITY, and IDENT_CURRENT
- SCOPE_IDENTITY、IDENT_CURRENT 和 @@IDENTITY
- @@IDENTITY、IDENT_CURRENT、SCOPE_IDENTITY的区别
- @@identity、scope_identity()、IDENT_CURRENT('tablename')函数的区别
- @@IDENTITY,IDENT_CURRENT,SCOPE_IDENTITY,IDENT_INCR,IDENT_SEED详解
- SQLServer中@@IDENTITY,SCOPE_IDENTITY和IDENT_CURRENT的作用
- ◎◎identity ,ident_current() ,scope_identity的区别
- sql server 2000 @@IDENTITY和SCOPE_IDENTITY和IDENT_CURRENT的区别
- SCOPE_IDENTITY、IDENT_CURRENT 和 @@IDENTITY返回插入到标识列中的值,但作用域不同
- SCOPE_IDENTITY、IDENT_CURRENT 和 @@IDENTITY的比较
- SCOPE_IDENTITY()、@@IDENTITY、IDENT_CURRENT() 用法
- @@identity , SCOPE_IDENTITY,IDENT_CURRENT 三者的异同
- @@IDENTITY,SCOPE_IDENTITY,IDENT_CURRENT,吉祥3宝
- SCOPE_IDENTITY、IDENT_CURRENT 和 @@IDENTITY
- 浅谈SCOPE_IDENTITY、IDENT_CURRENT 和 @@IDENTITY
- SQL Server返回最后一个标识值的三个函数:IDENT_CURRENT、@@IDENTITY、SCOPE_IDENTITY
- 关于如何使用SqlServer中@@Identity、@@IDENT_CURRENT、@@SCOPE_Identity获取自动生成列的值的区别(精简版)
- [转]IDENT_CURRENT、SCOPE_IDENTITY、@@IDENTITY 差異對照表
- @@identity, scope_identity ident_current 的区别
- IDENT_CURRENT ,@@identity,SCOPE_IDENTITY() 之间对比