IDENT_CURRENT(‘TableName‘)为当前的最大标识值,IDENT_INCR(‘TableName‘)为设置的标识值增量, 两者相加即为下一个标识值
SELECT IDENT_CURRENT(‘TableName‘) + IDENT_INCR(‘TableName‘);
参考链接:https://social.microsoft.com/Forums/zh-CN/07c3a188-5ae1-4623-ba14-0ae2148f5be0/sql-server-id?forum=sqlserverzhchs
时间: 2024-10-20 08:55:33