Solved

Reset Identity to some value

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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Suggested Solutions

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
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…
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

929 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