title: SQL how do you query for tables that refer to a specific foreign key value?
body: <p>I have table <code>A</code> with a primary key on column <code>ID</code> and tables <code>B,C,D...</code> that have 1 or more columns with foreign key relationships to <code>A.ID</code>.</p>
  
  <p>How do I write a query that shows me all tables that contain a specific value (eg <code>17</code>) of the primary key?</p>
  
  <p>I would like to have <strong>generic sql code that can take a table name and primary key value</strong> and display all tables that reference that specific value via a foreign key.</p>
  
  <p>The result should be a <strong>list of table names</strong>.</p>
  
  <p>I am using MS SQL 2012.</p>