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: )

587 reads

Blogs

Logging Messages with Raiserror – #SQLNewBlogger

By

Another post for me that is simple and hopefully serves as an example for...

Daily Coping 8 Mar 2021

By

I started to add a daily coping tip to the SQLServerCentral newsletter and to...

Webinar – Building a Proper SQL Server Database Security Model

By

Tomorrow, March 9, 2020, at 3 PM EST, I will be giving a presentation...

Read the latest Blogs

Forums

SSRS report download fails

By Tomys

Hi. I am trying to download a report from SSRS 2019 in word format...

Many executionplans for one query, why?

By oRBIT

I've yet to find an answer for this. I've found a few queries that...

Index on View

By AMCiti

Dear Group: I was going to create an index on a view we have,...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers