Solved

Reset Identity to some value

Posted on 2009-05-13
4
184 Views
Last Modified: 2012-05-06
Hi

I have a column that is auto-incremented, how do I reset its incremental value to 30 for example?

I need an SQL syntax for that. and the database that this column is in is of MS SQL 2000
0
Comment
Question by:alfardan
[X]
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
  • 2
4 Comments
 
LVL 6

Accepted Solution

by:
openshac earned 500 total points
ID: 24372660
DBCC CHECKIDENT (mytable, RESEED, 30)
0
 
LVL 6

Expert Comment

by:openshac
ID: 24372668
You might want to check the current identity value first:

DBCC CHECKIDENT ('mytable', NORESEED)
0
 
LVL 31

Expert Comment

by:RiteshShah
ID: 24372683
0
 
LVL 46

Expert Comment

by:tbsgadi
ID: 24373016
Have a look at the following:

http://technet.microsoft.com/en-us/library/ms176057.aspx

Good Luck!

Gary
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Suggested Solutions

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.

749 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