Reseed or Reindex Primary Key - SQL Server

Dealing with database sometimes requires to Reindex the Identity Column or Primary Key to Reindex.

Below is the command or Query to be run on SQL Server to Reseed / Reindex Identity column for SQL Server.

DBCC CHECKIDENT (tablename, reseed, 10)

Above statement will return current max value and reseed the identity from the value given as last parameter.


Here 10 is value to start from.


Comments

Popular posts from this blog

Are parents really responsible for their children's bad habits?

Unicode support Java