Red Gate forums :: View topic - Regarding SQL STATEMENT generator
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Data Generator 1
SQL Data Generator 1 forum

Regarding SQL STATEMENT generator

Search in SQL Data Generator 1 forum
Post new topic   Reply to topic
Jump to:  
Author Message
kiran.karamsetti



Joined: 02 Jan 2009
Posts: 4

PostPosted: Fri Jan 02, 2009 8:36 am    Post subject: Regarding SQL STATEMENT generator Reply with quote

Hi ,

I have tables like:

1. Rep(RepID, rep_name,Active) -> has id= 1 to 100 records
2. Role(RoleID, RoleCode, Active) -> has id = 1 to 30 records
3. RepRole(ID, RepID, RoleID)

and I need to populate the below table:

Table_1(id,name, created_repID,Created_RoleID).

So i am generating the data for created_repID randomly between 1 to 100. And I need to populate the Tables_1.Created_roleID from the REPROLE table for that respective Created_repID. How can I do this in RedGate generator tool?

Here i tried to write a query:
how to complete the below query. I need to pass the table_1.Created_repID as the parameter to the below query.
"Select RoleID from RepRole where repid =" + ?;

please give me a suggestion.


Last edited by kiran.karamsetti on Mon Jan 05, 2009 1:42 pm; edited 1 time in total
Back to top
View user's profile Send private message MSN Messenger
Brian Donahue



Joined: 23 Aug 2004
Posts: 6671

PostPosted: Fri Jan 02, 2009 4:02 pm    Post subject: Reply with quote

Hi,

It's not documented but I have been told that Data Generator cannot use newly-generated values to populate another column, so it wouldn't be possible to access data that has not yet been inserted into the database.

You could use a foreign key generator or foreign key (manual) generator to populate values from one column into another column.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group