Get Foreign Key of all the tables for Sqlserver DB

This script will create two views and select the data from the TableReferences view. This view will give list of all the foreignkeys of the selected database with its constraint name, the table name and column name(s) on which the constraint is created and the referencing table name and column name(s).

5 (2)

2006-09-25 (first published: )

588 reads

Blogs

Book Review: Lights Out

By

I have always been interested in GE since I was a kid. My best...

A Successful Blogger on Making the Switch

By

For Kyla Marie Charles, switching to WordPress.com opened up possibilities for her website and...

Login Timeouts

By

I was recently approached at work about a company that was seeing tons of...

Read the latest Blogs

Forums

SQL Server internal variable with DML type

By sergino.taglia

Can you advice how to retrieve the DML type a query is running? Does...

How to Convert Oracle SQL to T-SQL

By carlton 84646

Hello Community, I have been given a challenge of converting the following SQL code...

Right place for newly graduates?

By LeviHampton

Hi everyone, I have a brother who just graduated with a programming major. And...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers