Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

start records at a new number

Posted on 2014-01-29
4
262 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

829 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