Red Gate forums :: View topic - can SQL DG calculate a column value?
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

can SQL DG calculate a column value?

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



Joined: 18 Jan 2010
Posts: 10

PostPosted: Thu Mar 24, 2011 11:30 am    Post subject: can SQL DG calculate a column value? Reply with quote

Just evaluting SQL data generator and if anyone can tell me if this is possible.
Circa 10,000,000 row need to be created.

COL A (Qty) = Random number 1-50
COL B (Qty_Delivered) must be lower than COL A
COL C (Qty_Outstanding) = A-B
COL D (Inv Total Price) = A*E
COL E (Price)= Random cost 1.00-500.00

Col A and E are easy to produce.
Do I need to create a temp table or can this be done by script?
Back to top
View user's profile Send private message
peter.peart
Site Admin


Joined: 02 Sep 2008
Posts: 362
Location: Top floor, RG towers with the cool kids

PostPosted: Fri Mar 25, 2011 5:44 pm    Post subject: Reply with quote

Hi there,

Thanks for your post. Unfortunately, it isn't possible to populate data for columns based on the sum of other columns, i.e. dictate a column relationship other than PK > FK.

We do however have this as an existing feature request in place of which I will add your request to, however I sorry to say that we don't have a timescale at the moment for if / when this feature is likely be implemented.

HTH!

Pete
_________________
Peter Peart
Red Gate Software Ltd
+44 (0)870 160 0037 ext. 8569
1 866 RED GATE ext. 8569
Back to top
View user's profile Send private message Send e-mail
icecurtain



Joined: 18 Jan 2010
Posts: 10

PostPosted: Wed Mar 30, 2011 2:13 pm    Post subject: Reply with quote

Thanks for the reply. I would definitely like it as a new feature!
Back to top
View user's profile Send private message
tilo23



Joined: 22 Dec 2011
Posts: 19
Location: Berkshire, UK

PostPosted: Fri Dec 23, 2011 10:56 am    Post subject: Reply with quote

Hello,
It actually IS possible - you need to add a script creating trigger ON INSERT before the data generation. To do this Edit project and open Scripts tab.
_________________
Inside the Dilbert's world
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