---
title: "How can reset identity seeding in SQL on ID column ?"  
description: "How can reset identity seeding in SQL on ID column ?"  
author: "Anonymous User"  
published: 2018-08-02  
updated: 2023-06-18  
canonical: https://www.mindstick.com/forum/34651/how-can-reset-identity-seeding-in-sql-on-id-column  
category: "asp.net mvc"  
tags: ["c#", "asp.net mvc", "mvc", "mvc4"]  
reading_time: 2 minutes  

---

# How can reset identity seeding in SQL on ID column ?

Reset [identity](https://www.mindstick.com/articles/13090/icon-the-identity-of-your-brand) seeding in SQL [server](https://www.mindstick.com/articles/43769/what-is-serverless-architecture-is-it-worth-switching-over) on ID [column](https://www.mindstick.com/forum/33860/how-to-calculate-column-summary-in-sql-server) Where ID column is [auto increment](https://www.mindstick.com/forum/193/auto-increment-by-store-procedure).

And don't use the [drop](https://www.mindstick.com/forum/159392/how-to-fetch-the-value-of-the-selected-options-in-drop-down-in-php), [delete](https://www.mindstick.com/forum/33620/how-to-delete-record-from-list-in-mvc-using-ajax) or [truncate command](https://www.mindstick.com/forum/34655/what-is-the-difference-in-drop-delete-and-truncate-command-in-sql-server) on That table.

## Replies

### Reply by Aryan Kumar

There are two ways to reset identity seeding in SQL on an ID column:

- **Using the DBCC CHECKIDENT procedure:** The DBCC CHECKIDENT procedure can be used to reset the identity seeding for a specific table. The following code shows how to use the DBCC CHECKIDENT procedure to reset the identity seeding for a table named MyTable:

SQL

```plaintext
DBCC CHECKIDENT ('MyTable', RESEED, 1);
```

The RESEED parameter specifies the new value for the identity seed. In this case, the new value is 1.

- **Using the [TRUNCATE](https://www.mindstick.com/blog/313/difference-between-truncate-delete-statement-in-sql-server) TABLE statement:** The TRUNCATE TABLE statement can be used to truncate a table, which will reset the identity seeding for the table. The following code shows how to use the TRUNCATE TABLE statement to truncate a table named MyTable:

SQL

```plaintext
TRUNCATE TABLE MyTable;
```

## Which method should you use?

The best method to use depends on your specific needs. If you only need to reset the identity seeding for a small number of rows, then the DBCC CHECKIDENT procedure is a good option. However, if you need to reset the identity seeding for a large number of rows, then the TRUNCATE TABLE statement is a better option.

## Here are some things to keep in mind when resetting identity seeding:

- Resetting identity seeding will not affect the existing rows in the table.
- Resetting identity seeding will cause the next identity value to be 1.
- If the table has foreign key constraints, then you may need to update the foreign key values after resetting the identity seeding.

### Reply by Anonymous User

DBCC CHECKIDENT ('[TestTable]', RESEED, 0); GO\
Hope it'll help you.


---

Original Source: https://www.mindstick.com/forum/34651/how-can-reset-identity-seeding-in-sql-on-id-column

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
