Reputation: 8616
In my SQL db, I ran the following script to clean up data and reset the identity columns,
-- disable referential integrity
EXEC sp_MSForEachTable 'ALTER TABLE ? NOCHECK CONSTRAINT ALL'
GO
EXEC sp_MSForEachTable 'DELETE FROM ?'
GO
-- enable referential integrity again
EXEC sp_MSForEachTable 'ALTER TABLE ? CHECK CONSTRAINT ALL'
GO
EXEC sp_MSforeachtable @command1 = 'DBCC CHECKIDENT(''?'', RESEED, 1)'
Go
I get the following messages,
Checking identity information: current identity value 'NULL'.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
Checking identity information: current identity value '1'.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
Checking identity information: current identity value '1'.....
Message being printed for all the tables I guess. Identity has been reset and data has been removed. Do I need to worry about this message?
Upvotes: 3
Views: 26507
Reputation: 3216
No.
create table t1(col1 int identity(1,1),col2 int)
insert into t1 select 1
insert into t1 select 2
insert into t1 select 3
delete from t1
DBCC CHECKIDENT(t1, RESEED, 1)
Checking identity information: current identity value '3', current column value '1'.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
It is just like system predefined message , only the counter will differ( in the example i shown above it is '3'(current identity) and '1'(target identity number))
Upvotes: 2