Powered by Blogger.

Thursday, April 24, 2014

Reset auto increment sql server 2008 - Reset Table Identity Sql Server 2008

In this post we will discuss how to reset auto incremented table value in Sql Server 2008. This is nothing but we are resetting the Table identity in Sql Server 2008.

Also you can check out:

- How to handle exception in sql server stored procedure?

- Get all time zones in C#.Net

- Tutorial on WPF Controls and Layout

We can reset the identity value by using DBCC CHECKIDENT.

Below is the command:

DBCC CHECKIDENT ("Table Name", RESEED, 0);

Here the next value will start from 1 (Next value of 0)

Similarly suppose you have a table with 25 rows with Auto Incremented value as 25. Now suppose you want to set the value to 50 then you can write like below:

DBCC CHECKIDENT ("Table Name", RESEED, 50);


0 comments

Post a Comment