Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 Script Library
 SQL Schema Foreign key Relationships
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

1 Posts

Posted - 10/26/2012 :  07:44:54  Show Profile  Reply with Quote
I have a SQL Server 2008 DB (A)with more than 400 tables where in tables have many constraints(foreign key relationships). I need to transfer a chunk of data from Database (A) to another DB (B) based upon many rules.
In order to append the data from tables in DB (A) to tables in DB (B) the data in the child table needs to be appended and then the data in the parent table needs to be appended.

Is there any tool that would generate the complete relationships of the schema starting from the base child table and cascading along.

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 10/26/2012 :  10:26:36  Show Profile  Reply with Quote
This script finds table references and ranks them by level in order to be able to load tables with FK references in the correct order.

Find Table Reference Levels

Go to Top of Page

Starting Member

6 Posts

Posted - 11/20/2012 :  22:40:33  Show Profile  Reply with Quote
Thank you for this article. That’s all I can say. You most definitely have made this blog into something special. You clearly know what you are doing, you’ve covered so many bases.Thanks!

xingchen chen123
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2019 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000