in

code for eternity !!!

community website for .net freaks ;-)

Technology

Using sp_fkeys to find all Foreign Keys pointing to a Table

We can use the sp_fkeys system stored procedure to find all foreign keys which point to a particular table. The following T-SQL command will return a list of all tables which are referencing the primary key of the Products table:

EXEC sp_fkeys Products

The sp_fkeys system stored procedure comes very handy when dealing with large databases which have hundreds of tables.

Cheers,
Raj

~~~ CODING FOR ETERNITY !!! ~~~

Published Jan 20 2008, 01:50 PM by raj
Filed under:

I would really appreciate votes / kicks for this blog post if you found it useful ;-)

  kick it on DotNetKicks.com     Receive Email Updates


Comments

 

DotNetKicks.com said:

You've been kicked (a good thing) - Trackback from DotNetKicks.com

February 21, 2008 4:12 AM

Leave a Comment

(required)  
(optional)
(required)  
Add
Powered by Community Server (Non-Commercial Edition), by Telligent Systems