Solved

start records at a new number

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Parse field in SQL View 15 99
need help in sql 4 67
Updating a table from a temp table 4 30
sql2012 on vm use high  cpu even with simple query 7 16
Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

863 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now