Check out my recent article in SQL Server magazine June edition to display the tables in hierarchical manner based on the relations.http://www.sqlmag.com/Article/ArticleID/101931/sql_server_101931.html.This article is specifically to produce the list of all the tables across the schemas hierarchically based on the relationships, so what is so special about this ?
Below are the top 3 advantages:.Database Migration
Migrating data from legacy database to SQL Server, this script will give you 2 sets where the set A contains the list of the independent tables with out any relation where you can migrate the data at a single step.
Set B contains the list of the tables in hierarchy .
check the below link for migrating the data using this stored procedure.
Run this procedure and design your package based on the sequence from the output.
Validate your schema
Through this you can validate your database design as it produce the table list which are in conflicts due to self referencing (one-many & many-one)
Masking data can be done through scrubbing the sensitive fields (SSN, credit card number) , but scrubbing the primary field requires populating the relational foreign key values at the same time.
Check out this article about how to scrub the data in development environment to hide the sensitive information using one of the statements inside this procedure