Solved

set IDENTITY

Posted on 2006-06-26
3
304 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

I have a large data set and a SSIS package. How can I load this file in multi threading?
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
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…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.

634 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