Solved

start records at a new number

Posted on 2014-01-29
4
264 Views
Last Modified: 2014-01-29
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?
0
Comment
Question by:NickMalloy
4 Comments
 
LVL 15

Accepted Solution

by:
tim_cs earned 300 total points
ID: 39819178
DBCC CHECKIDENT (TableName, RESEED, 4999)
0
 
LVL 16

Expert Comment

by:Surendra Nath
ID: 39819186
solution

you can change your identity seed to 5000 as shown below

DBCC CHECKIDENT ('<yourtable.YourColumn>', RESEED, 5000);
0
 
LVL 31

Expert Comment

by:James Murrell
ID: 39819187
i use reseed

something like DBCC CHECKIDENT (TableName, RESEED, 4999)
0
 
LVL 65

Expert Comment

by:Jim Horn
ID: 39819202
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

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question