debugsqlMinor
DBCC CHECKIDENT ('table name', RESEED, 20000) not working
Viewed 0 times
dbccworkingreseednamecheckident20000nottable
Problem
When I run the script
the output of the message is
Checking identity information: current identity value '200000', current
column value '200000'. DBCC Execution completed. If DBCC printed error
messages, contact your system administrator.
When I query the identity value by running
it is showing up as 200000 as expected, however, when the developer inserts records into the table, it's not using the new reseeded value.
Is there something obvious I'm missing?
DBCC CHECKIDENT ('table name', RESEED, 20000)the output of the message is
Checking identity information: current identity value '200000', current
column value '200000'. DBCC Execution completed. If DBCC printed error
messages, contact your system administrator.
When I query the identity value by running
SELECT IDENT_CURRENT('table_name')it is showing up as 200000 as expected, however, when the developer inserts records into the table, it's not using the new reseeded value.
Is there something obvious I'm missing?
Solution
It turns out after multiple conversations with the developers of this application using the table that there was a 'hidden' stored procedure that was grabbing the maximum value of the ID column in the table and adding an arbitrary number to it then issuing an IDENTITY_INSERT statement resulting in the newly reseeded value.
Context
StackExchange Database Administrators Q#123990, answer score: 5
Revisions (0)
No revisions yet.