Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 12.0.0 (中文) » SQL Anywhere 服务器 - SQL 的用法 » SQL 方言和兼容性 » 为实现 Transact-SQL 兼容性配置数据库 » 特殊 IDENTITY 列

 

使用 @@identity 检索 IDENTITY 列值

当您第一次将行插入表中时,IDENTITY 列将被分配值 1。对于每次后继的插入,该列的值都会递增 1。最近插入标识列的值可在 @@identity 全局变量中提供。

有关 @@identity 的行为的详细信息,请参见@@identity 全局变量