Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

set IDENTITY

Posted on 2006-06-26
3
Medium Priority
?
307 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 70

Accepted Solution

by:
Scott Pletcher earned 2000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
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 INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

876 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