Hardcode the Foreign Key value

The simplest way to populate your database with test data.

Moderators: David Atkinson, Anu Deshpande, Lionel

Hardcode the Foreign Key value

Postby hashcoderz » Tue Apr 24, 2012 7:15 am

Hi

I have a User table with UserStatusId as foreign key, where UserStatus table have two rows

UserStatusId Name
1 Active
2 Deleted

I am going to populate the User table, but i need to populate only Active users, that means UserStatusId is 1.

How should i do it in SQL Data Generator 1? Any suggestions?
hashcoderz
 
Posts: 1
Joined: Tue Apr 24, 2012 7:08 am

Postby Manfred.Castro » Wed Apr 25, 2012 10:32 am

I believe using the Generic - SQL Statement generator may be able to accomplish what you are looking for.

See here for more information.

http://www.red-gate.com/supportcenter/Content?p=SQL%20Data%20Generator&c=SQL_Data_Generator/help/1.2/SDG_generic_generators.htm&toc=SQL_Data_Generator/help/1.2/toc52077.htm#o5532

Hope this helps.
Manfred Castro
Product Support
Red Gate Software
Manfred.Castro
 
Posts: 209
Joined: Mon Apr 23, 2012 2:49 pm


Return to SQL Data Generator 1

Who is online

Users browsing this forum: No registered users and 0 guests