title: drop and recreate ALL constraints combine with sp_MSForEachTable sql server
body: <p>I'm doing some test data loading with SSIS into our data warehouse and have come across the old chestnut of foreign key constraints.  I'm going to be removing/adding all data looking for data issues in my local test environment.  Therefore I could care less about referential integrity at this point... I came across this handy little query:</p>
  
  <pre><code>-- disable referential integrity
  EXEC sp_MSForEachTable 'ALTER TABLE ? NO CHECK CONSTRAINT ALL' 
  GO 
  
  EXEC sp_MSForEachTable 'TRUNCATE TABLE ?' 
  GO 
  
  -- enable referential integrity again 
  EXEC sp_MSForEachTable 'ALTER TABLE ? CHECK CONSTRAINT ALL' 
  GO
  </code></pre>
  
  <p>The only problem is it is useless if you have foreign key constraints as you have to actually drop them.  Is there any way of combining this query with something that will Drop/Recreate all constraints???</p>