Options

Generate data from lookup table- Field combination

Hi All,

I am newbie to SQL data generation and have question on lookup table.I am trying to put simple example to explain my problem.

Synthetic data need to be generated in Employee table.It has below columns
EmpName, EmpId, DepCode ,DepName ,DepLocation

I want to insert random record (all three field combination) from below lookup table to Employee table
DepCode   DepName  DepLocation
1                 ABC          TX
2                 BCD          NC
3                 EFG           GA

Any help will be appreciated.
Tagged:

Answers

  • Options
    Hi @Shashank,

    SQL Data Generator is able to insert data from external datasets, but it is not very good at inserting correlated data - it may be possible using a complex python generator, but it is not the best use case.

    This is something that Data Masker for SQL Server is quite good at though and there are a few options.  The most obvious is the Insertion Rule - see this page for more information.  This may or may not coincide with a user defined dataset (see this page and the examples on this page - specifically the correlated dataset) for the information from your lookup table which would be the easiest way.

    You could likely generate the data as above with some substution rules and then for the Employee table and then use the the Table to Table synchronization rule (see this page) to bring in the the data from your lookup table.

    I hope that helps!

    Kind regards,
    Alex
    Product Support Engineer | Redgate Software

    Have you visited our Help Center?
Sign In or Register to comment.