Tuesday, October 13, 2009

What’s up?

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
SSIS Development
Data Masking
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.

SSIS Development
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)
Data Masking

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


  1. is there any parameter i should pass to validate the schema through this procedure?

  2. very helpfull i was looking for a solution for data masking in sql server and found this is very helpful


Featured Post

SQL Server AWS Migration BCP

stored procedure to generate BCP scritps to migrate the SQL Server database. Developed this stored procedure on my labs to simulate t...