devxlogo

Reseed All Autonumber Fields in All Tables

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)

devx-admin

Share the Post: