title: Query to find all FK constraints, and their referenced table columns
body: <p>I have a large SQL 2012 database (100 tables), in which I need to find all constraints where the referential action is set to CASCADE (update or delete).</p>
  
  <p>In <a href="https://stackoverflow.com/a/3877564/792888">this useful answer</a> I see that I can list the constraints using the following T-SQL (adapted slightly):</p>
  
  <pre><code>SELECT
      name,
      delete_referential_action_desc,
      update_referential_action_desc
  FROM
      sys.foreign_keys
  WHERE
      update_referential_action_desc = 'CASCADE' OR
      delete_referential_action_desc = 'CASCADE';
  </code></pre>
  
  <p>This provides a useful list:</p>
  
  <pre><code>name        delete_referential_action_desc      update_referential_action_desc
  ----------------------------------------------------------------------
  FK_name001  CASCADE                             CASCADE
  FK_name002  CASCADE                             NO_ACTION
  FK_name003  CASCADE                             NO_ACTION
  </code></pre>
  
  <p>However, is it possible to expand the code, so that for each constraint the respective table names and columns names are included, e.g.?</p>
  
  <pre><code>name        delete_referential_action_desc      update_referential_action_desc  ParentTable ParentCol   ChildTable  ChildCol
  ----------------------------------------------------------------------------------------------------------------------------
  FK_name001  CASCADE                             CASCADE                         Table1      Col1        Table2      Col2
  </code></pre>
  
  <p>I've tried different edits pulling in values from <code>sys.objects</code> but cannot figure out how it works, or whether that's even the correct approach. </p>
  
  <h1>Update</h1>
  
  <p>Please note that I <strong>do not want</strong> to <code>ALTER</code> anything, or make any schema changes.  I just want to view a list so that I can perform further actions manually.  I do not have the confidence or experience to <a href="https://stackoverflow.com/a/11639982/792888">edit this gigantic query</a> to pull out the salient points.</p>