Solved

Reset Identity to some value

Posted on 2009-05-13
4
177 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
Comment Utility
DBCC CHECKIDENT (mytable, RESEED, 30)
0
 
LVL 6

Expert Comment

by:openshac
Comment Utility
You might want to check the current identity value first:

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

Expert Comment

by:RiteshShah
Comment Utility
0
 
LVL 46

Expert Comment

by:tbsgadi
Comment Utility
Have a look at the following:

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

Good Luck!

Gary
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
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…
Viewers will learn how the fundamental information of how to create a table.

762 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

11 Experts available now in Live!

Get 1:1 Help Now