I am working with SQL Server 2008 R2.
I have a table seq_audit
which has an identity column. This is the definition of the table:
CREATE TABLE [dbo].[seq_audit]
(
[id] [bigint] IDENTITY(1,1) NOT NULL,
[value] [bit] NULL,
PRIMARY KEY CLUSTERED ([id] ASC)
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF,
IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON,
ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
The table is empty and never has had any rows in it before.
To check its current identity value, I ran this command:
DBCC CHECKIDENT (seq_audit, NORESEED)
GO
And this is the result I get:
Checking identity information: current identity value 'NULL', current column value 'NULL'. DBCC execution completed. If DBCC printed error messages, contact your system administrator.
I want to set its current identity value to 15953711. So I ran this command:
DBCC CHECKIDENT (seq_audit, RESEED, 15953711)
GO
And this is the result I get:
Checking identity information: current identity value 'NULL', current column value '15953711'. DBCC execution completed. If DBCC printed error messages, contact your system administrator.
I thought it worked so I again check its current identity by running this command:
DBCC CHECKIDENT (seq_audit, NORESEED)
GO
But I was not expected the result I get:
Checking identity information: current identity value 'NULL', current column value 'NULL'. DBCC execution completed. If DBCC printed error messages, contact your system administrator.
So somehow the setting of current identity value is not working. Why? What am I doing wrong here?