Click here to Skip to main content
15,880,796 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want my id back to 0 after deleting all the records

What I have tried:

Newbie here, I'm not really good using about Sql server but can show me step by step?
Posted
Updated 11-Jul-18 18:03pm

1 solution

Here is an example to reset the new identity to start from 1
SQL
DBCC CHECKIDENT ('TableName', RESEED, 1)

https://www.c-sharpcorner.com/blogs/how-to-reset-identity-column-values-in-sql-server1

DBCC CHECKIDENT (Transact-SQL) | Microsoft Docs[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900