Donate

Reset Autonumber Or Identity Column In Sql Server Transact SQL

Here is the script to reset autonumbers in sql server. Usually, i have to delete the table contents and then reseed the tables.

TSQL Script:
  use Transmittal  
  go  
  delete from dbo.TransDetails;  
  delete from dbo.TransMaster;  
  DBCC CHECKIDENT (TransMaster, reseed, 0)  
  DBCC CHECKIDENT (TransDetails, reseed, 0)  

Comments

Donate

Popular Posts From This Blog

WPF CRUD Application Using DataGrid, MVVM Pattern, Entity Framework, And C#.NET

TypeScript Error Or Bug: The term 'tsc' is not recognized as the name of a cmdlet, function, script file, or operable program.

Invalid nested tag div found, expected closing tag input