title: SQL Server: Howto get foreign key reference from information_schema?
body: <p>In SQL Server, how can I get the referenced table + column name from a foreign key?</p>
  
  <p>Note: Not the table/column where the key is in, but the key it refers to.</p>
  
  <p>Example:</p>
  
  <p>When the key <code>[FA_MDT_ID]</code> in table <code>[T_ALV_Ref_FilterDisplay]</code>.
  refers to <code>[T_AP_Ref_Customer].[MDT_ID]</code></p>
  
  <p>such as when creating a constraint like this:</p>
  
  <pre><code>ALTER TABLE [dbo].[T_ALV_Ref_FilterDisplay]  WITH CHECK ADD  CONSTRAINT [FK_T_ALV_Ref_FilterDisplay_T_AP_Ref_Customer] FOREIGN KEY([FA_MDT_ID])
  REFERENCES [dbo].[T_AP_Ref_Customer] ([MDT_ID])
  GO
  </code></pre>
  
  <p>I need to get <code>[T_AP_Ref_Customer].[MDT_ID]</code>
  when given <code>[T_ALV_Ref_FilterAnzeige].[FA_MDT_ID]</code> as input</p>