Solved

Reset Identity to some value

Posted on 2009-05-13
4
180 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
  • 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

I'm trying, I really am. But I've seen so many wrong approaches involving date(time) boundaries I despair about my inability to explain it. I've seen quite a few recently that define a non-leap year as 364 days, or 366 days and the list goes on. …
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
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…

777 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