1 --首先创建一个表 2 CREATE TABLE [dbo].[abcd]( 3 [id] [int] IDENTITY(3,4) NOT NULL, 4 [NAME] [varchar](50) NULL, 5 [remark] [varchar](200) NULL 6 ) ON [PRIMARY] 7 8 9 --获取起始值 10 SELECT IDENT_CURRENT(‘abcd‘)--起始值 11 --获取增量 12 SELECT IDENT_INCR(‘abcd‘) 13 --判断 自增列 14 SELECT syscolumns.name,IsIncrementColumn = cast(CASE syscolumns.status 15 WHEN 128 THEN 1 16 ELSE 0 17 END AS bit) FROM syscolumns 18 WHERE syscolumns.id = ( SELECT id 19 FROM sysobjects 20 WHERE name = ‘abcd‘ 21 )
时间: 2024-11-07 05:40:49