Solved

set IDENTITY

Posted on 2006-06-26
3
299 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:
Scott Pletcher 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

816 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

7 Experts available now in Live!

Get 1:1 Help Now