devxlogo

May 27, 2019

Reseed All Autonumber Fields in All Tables

Reseed all Autonumber fields in all tables with the following query: EXEC sp_MSForEachTable ‘ IF OBJECTPROPERTY(object_id(”?”), ”TableHasIdentity”) = 1 DBCC CHECKIDENT (”?”, RESEED, 0)