hierarchical data Creation

The simplest way to populate your database with test data.

hierarchical data Creation

Postby Doug.Thompson » Thu Apr 01, 2010 10:14 am

Lets assume we have cols called:
- Country
- StateProvince
- Country
- City

You cant have independant data in there (eg there is no Arizona in Scotland or Edinburgh in Nebraska that I know of) so you need a dependancy.

A quick fix for you is to allow for the column data to be provided via user stored proceedure when the passed value is a column key (eg $1 for colum one or $+2 for 2 cols away from this one).
The data patterns could be cached for the generate batch run. It taking a bit longer is better than not at all.
You could always have data maps, where you select a file eg {$1}.txt and use a selection of values in there.
You could have a VBScript breakout so that you could return the data you wanted. Slow but versatile.
These lists need to be weighted so you can have a realistic demograghic.
Introduce the $1 column selector into regular expressions so you can affect another column. There is a risk of cyclic dependancy but the easiest option is the USP (and Views) route I think.

Once the data is generated it would be nice to export the data as a drop/create/insert script (easy in sql2008) .

The only option I can see at the moment is running post production scripts trying to modify ver1 of the table using $1 as the first key feild, then doing it again with S2 and so on. How tedious is that.
We pay a lot for these redgate tools and this sort of features is quite realistic.

Doug BN1.UK
Posts: 1
Joined: Thu Apr 01, 2010 9:51 am
Location: UK

Postby Brian Donahue » Mon Apr 05, 2010 2:49 pm

We usually recommend the IronRuby generator as a possibility to insert derived data into the database. SQL Data Generator doesn't support basing new data fields on ones that are being inserted by the generator, but this is an alternative workaround that you can use without having to modify the database. For the complete information, please see:

http://www.simple-talk.com/dotnet/.net- ... generator/
Brian Donahue
Posts: 6590
Joined: Mon Aug 23, 2004 10:48 am

Return to SQL Data Generator Previous Versions

Who is online

Users browsing this forum: No registered users and 1 guest