Solved

set IDENTITY

Posted on 2006-06-26
3
297 Views
Last Modified: 2012-08-14
I have a table with identity and for some reason I removed the identity and forgot to return it.
When I finally returned it I got a very high number not what I was expected. How do set the identity to start from
a certain value that I choose?
Thankyou
Anat
0
Comment
Question by:ANAT2403
3 Comments
 
LVL 10

Expert Comment

by:ibost
ID: 16988195
you can use DBCC CHECKIDENT perhaps

Look it up in BOL.
0
 
LVL 69

Accepted Solution

by:
ScottPletcher earned 500 total points
ID: 16988208
DBCC CHECKIDENT ( 'table_name', RESEED, new_starting_value )
0
 
LVL 4

Expert Comment

by:Winsen
ID: 16990189
In addition to ScottPletcher's comment, please pay attention that, the next value insert would be (new_starting_value + 1) if new_starting_value > 1.
0

Featured Post

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

747 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

10 Experts available now in Live!

Get 1:1 Help Now