February 14, 2006 at 10:54 pm
Hi,
How to reset PK identity column to 0 value?
Regards,
GB
February 15, 2006 at 1:11 am
If you want to reset an identity range then
DBCC CHECKIDENT('YourTable',RESEED,0)
If you want to explicitly add a record that over rides the identity then
SET IDENTITY_INSERT dbo.YourTable ON
INSERT Yourtable(PKField,OtherFields) VALUES (0,Yourvalues)
SET IDENTITY_INSERT dbo.YourTable OFF
February 15, 2006 at 2:06 am
Hi David,
Thanks for the quick help. This solves my problem
Regards,
GB
February 16, 2006 at 6:30 am
If the table is empty, TRUNCATE TABLE user.tablename will do it as well.
February 16, 2006 at 9:32 pm
TRUNCATE works on empty table: this is also helpful. Thanks for this trick too.
Regards, GB
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply