Reset Identity in SQL Server Tables of a Database

posted @ Sunday, February 14, 2010 7:47 AM

 

Run this command against your database:

exec sp_MSforeachtable 'IF OBJECTPROPERTY(OBJECT_ID(''?''), ''TableHasIdentity'') = 1 BEGIN DBCC CHECKIDENT (''?'',RESEED,0) END'

Comments
No comments posted yet.
Post Comment






Please add 4 and 6 and type the answer here: