关于IDENTITY的一些用法
--获取当前表的标识值
select IDENT_CURRENT( 'tbUserLogin' )
--设置表的标识值为14
DBCC CHECKIDENT('tbUserLogin',RESEED,14 )
--获取当前表的标识值的增量值
SELECT IDENT_INCR('tbUserLogin') AS Identity_Increment
--
SELECT IDENT_SEED('tbUserLogin') AS Identity_Seed
--
SET IDENTITY_INSERT tablename ON
declare @ID INT select @ID=IDENT_CURRENT( 'tbTest' ) +1 DBCC CHECKIDENT( 'tbTest ',RESEED, @ID) SELECT @ID