Click here to Skip to main content
13,704,418 members
Rate this:
 
Please Sign up or sign in to vote.
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 11-Jul-18 17:54pm
Updated 11-Jul-18 18:03pm

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Here is an example to reset the new identity to start from 1
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[^]
  Permalink  

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Cookies | Terms of Service
Web01-2016 | 2.8.180920.1 | Last Updated 12 Jul 2018
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100