title: Drop and Recreate constraints script
body: <p>I have a table names Employee which is referenced to almost 85 tables in database. I want to make few changing in the table structure and for that I have to drop and recreate the table but as this is referenced to so many table I can't drop it. Can I somehow get the script of the constraints to drop and recreate them as I need those constraints too. I cannot afford to drop them forever.</p>
  
  <p>I am able to find the names of child table and constraint but I want the script where I can drop and recreate the constraint.</p>
  
  <pre><code>SELECT name AS 'Foreign Key Constraint Name', 
             OBJECT_SCHEMA_NAME(parent_object_id) + '.' + OBJECT_NAME(parent_object_id) AS 'Child Table'
     FROM sys.foreign_keys 
     WHERE OBJECT_SCHEMA_NAME(referenced_object_id) = 'HRM' AND 
                OBJECT_NAME(referenced_object_id) = 'tbl_EmployeeInfo'
  </code></pre>
  
  <p>Best</p>