.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Sharon Maxwell

Home >> Forum >> Sql Server >> Post New QuestionBookmark and Share Subscribe to Forum

how to reset identity column value in a table in sql server

Posted By: Ramesh     Posted Date: April 22, 2009    Points:2   Category :Sql Server
how to reset identity column value to 1 in sql server. Right now the value is 56 and if i am inserting new row i want to insert it from 1 not from 57. i am using MS SQl server 2005.


Author: Athira Sreejith             
Posted Date: April 22, 2009     Points: 5   





Author: Praveen             
Posted Date: April 23, 2009     Points: 5   

Hi Ramesh,
Use this code to reset you sql server table seed

DBCC CHECKIDENT ('Table-Name', reseed, 1)

Author: Dana             
Posted Date: April 27, 2009     Points: 5   

Or Else you can use the

Truncate table Command of sql

Author: Meetu Choudhary             
Posted Date: April 30, 2009     Points: 5   

Try This Code

DBCC CHECKIDENT ('your-tablename', reseed, 1)

where 1 is the reseed value...

Post Reply

You must Sign In To post reply
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend