[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

MSSQL Wish to to reset the column with correct sequence post insert/delete data in an auto increment (auto id ) column

Posted on 2009-05-14
5
Medium Priority
?
317 Views
Last Modified: 2012-05-07
MSSQL Wish to to reset the column with correct sequence post insert/delete data in an auto increment (auto id ) column  
0
Comment
Question by:npglobal
[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
  • 2
  • 2
5 Comments
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 24392425
DBCC CHECKIDENT (yourtable, reseed, UrExpectedNextNumber-1)
0
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 24392429
if you want to restart the number from 1, you  just need to TRUNCATE the table
0
 

Author Comment

by:npglobal
ID: 24392498
Thanks,
     Is there no slution except truncating the table and then restting it.
0
 
LVL 31

Accepted Solution

by:
RiteshShah earned 750 total points
ID: 24392575
0
 

Author Closing Comment

by:npglobal
ID: 31581803
Thanks a lot
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

If you having speed problem in loading SQL Server Management Studio, try to uncheck these options in your internet browser (IE -> Internet Options / Advanced / Security):    . Check for publisher's certificate revocation    . Check for server ce…
In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

656 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