Skip to content

Instantly share code, notes, and snippets.

@cmendesce
Last active December 15, 2015 02:29
Show Gist options
  • Select an option

  • Save cmendesce/5187188 to your computer and use it in GitHub Desktop.

Select an option

Save cmendesce/5187188 to your computer and use it in GitHub Desktop.
exec sp_MSforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT ALL'
exec sp_MSforeachtable 'ALTER TABLE ? DISABLE TRIGGER ALL'
exec sp_MSforeachtable 'DELETE ?'
exec sp_MSforeachtable 'ALTER TABLE ? CHECK CONSTRAINT ALL'
exec sp_MSforeachtable 'ALTER TABLE ? ENABLE TRIGGER ALL'
exec sp_MSforeachtable 'IF OBJECTPROPERTY(OBJECT_ID("?"), "TableHasIdentity") = 1 BEGIN DBCC CHECKIDENT ("?",RESEED,1) END'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment