start records at a new number

I have a table that contains data. I started the identity seed at 4000. Is there a way to have brand new records start at 5000?
NickMalloyAsked:
Who is Participating?
 
tim_csConnect With a Mentor Commented:
DBCC CHECKIDENT (TableName, RESEED, 4999)
0
 
Surendra NathTechnology LeadCommented:
solution

you can change your identity seed to 5000 as shown below

DBCC CHECKIDENT ('<yourtable.YourColumn>', RESEED, 5000);
0
 
James MurrellProduct SpecialistCommented:
i use reseed

something like DBCC CHECKIDENT (TableName, RESEED, 4999)
0
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
The high-tech answer would be DBCC CHECKIDENT
CREATE TABLE #tmp (id int identity(1,1), label varchar(50))

INSERT INTO #tmp (label) VALUES ('one'), ('two'), ('three')

DBCC CHECKIDENT (#tmp, RESEED, 999)

INSERT INTO #tmp (label) Values ('one thousand')

SELECT * FROM #tmp

Open in new window

The low-tech answer would be to just insert and delete however many rows get you to 4,999.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.