Once upon a time, Princeton Softech had the perfect solution for you; namely RelTools.
Recently however, Princeton Softech was acquired by IBM. Princeton Softech’s toolset is now presented under a different name:
Test Data Management
Enterprise data management includes capabilities for streamlining the total application testing process to speed deployment while controlling costs. Improving the way you manage test data can deliver dramatic results – faster time-to-market, reduced development costs and higher quality. In short, enterprise data management helps you do more with less.
IBM® Optim™ offers comprehensive test data management capabilities for creating realistic, right-sized test databases, protecting data privacy in vulnerable development and testing environments and validating test results. You eliminate costly cloning processes and correct defects early in the development process – where they are cheapest and easiest to fix. Most importantly, Optim scales to meet your development and testing requirements, across applications, databases, operating systems and hardware platforms.
Computer Associates also has a data extract product that pulls data from tables related by RI or by user defined relationships.
Trying to build this type of tool yourself will take more than 2 FTE years and would still not be as fool proof as IBM’s or CA’s products.
Perhaps you may want to consult the Gartner Group.