Monday, March 12, 2012

Identity insert doubt

Hello,

How do I get SQL server 2000 to continue the sequence of identity
column values after I perform an insert into the table with the set
identity_insert <table name> on statement? Eg if I insert values into
the identity column with values 1-999, how do I get the next number to
be 1000? Can the identity seed value be changed if there are records in
the table? Can the identity seed value be re-set to start again from 1?
Thanks
IsaacIDENTITY will automatically take the next number after the highest value
inserted when you turn IDENTITY_INSERT off again. Use DBCC CHECKIDENT to
change the IDENTITY seed value at any time.

--
David Portas
SQL Server MVP
--|||DBCC CHECKIDENT(<TableName>, RESEED)|||Thank you David and Dishan. Using DBCC CHECKIDENT worked just fine.
Dishan Fernando wrote:
> DBCC CHECKIDENT(<TableName>, RESEED)

No comments:

Post a Comment