Skip to content

Instantly share code, notes, and snippets.

@AlbertoMonteiro
Created December 20, 2017 20:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlbertoMonteiro/e2090ed27f01f83e7fa5f3630b054ebd to your computer and use it in GitHub Desktop.
Save AlbertoMonteiro/e2090ed27f01f83e7fa5f3630b054ebd to your computer and use it in GitHub Desktop.
Disable constrains SQL Server
EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
EXEC sp_msforeachtable 'ALTER TABLE ? WITH CHECK CHECK CONSTRAINT all'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment