November 19, 2007 at 1:24 pm
We have a table "A" in production and its twin "A" in development. The tables are identical (via Sql Compare); both use an identiity field as primary key.
When we run
delete from A
DBCC CHECKIDENT (A, RESEED, 0)
and add a new record, we find the identity field starts at 1.
When we run
delete from B
DBCC CHECKIDENT (B, RESEED, 0)
and add a new record, we find the identity field starts at 0.
Any ideas on this one?
TIA,
barkingdog
November 19, 2007 at 4:59 pm
If you just TRUNCATE the tables, no reseeding is necessary... IDENTITY columns will start over.
--Jeff Moden
Change is inevitable... Change for the better is not.
November 19, 2007 at 10:12 pm
Hi,
Your table B was empty so when you run the following command, the new identity will start with a value of 0
delete from B
DBCC CHECKIDENT (B, RESEED, 0)
When you DBCC CHECKIDENT (tablename, RESEED, 0) and tablename is vergin table, when you insert new record your counter start at 0.
Regards,
Ahmed
November 20, 2007 at 5:50 pm
Thanks for your answer.
Barkingdog
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply