Red Gate forums :: View topic - Populate a column conditional on data from another column???
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

Populate a column conditional on data from another column???

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



Joined: 13 Jun 2008
Posts: 1

PostPosted: Fri Jun 13, 2008 4:41 pm    Post subject: Populate a column conditional on data from another column??? Reply with quote

Is it possible to configure a column to be populated based on the values of another column within the table?

For example,
I have a table with two fields both integers. I configure column A to be populated with a random number between 0 and 10.
Now I only want column B to be populated (with the value 1) if column A is greater than 5.

Is this possible?

Thanks in advance
_________________
Smile
Back to top
View user's profile Send private message
benhall



Joined: 14 Dec 2007
Posts: 98

PostPosted: Fri Jun 13, 2008 5:32 pm    Post subject: Reply with quote

Hello,

Thanks for your post. Currently, this is not possible within the application, however I have made a note to review your request for future versions.

Thanks

Ben
Back to top
View user's profile Send private message
dlutz



Joined: 16 Feb 2008
Posts: 18

PostPosted: Wed Jul 23, 2008 5:46 pm    Post subject: Reply with quote

No reply necessary.

I would like to add my 2 cents on this feature - it would be VERY handy. I have a table where there is a CaseType column and a CaseSubType column. Some CaseType/CaseSubType value combinations are not valid. So to be able to constrain the value of CaseSubType based on the value of CaseType would be a great feature.
Back to top
View user's profile Send private message
jarito



Joined: 02 Sep 2009
Posts: 2

PostPosted: Wed Sep 02, 2009 2:00 pm    Post subject: Reply with quote

I would also like this. I have an app where every table has a Modified By and Modified Date. However, since we have a lot of legacy data, there are nulls in the columns. I would like to generate random modified by's, but then only generate a date if there is a non-null modify by.
Back to top
View user's profile Send private message
Random Lengths



Joined: 29 Sep 2008
Posts: 25
Location: Eugene, OR

PostPosted: Wed Oct 14, 2009 4:44 pm    Post subject: Similair bu tnot the same request Reply with quote

I have a reporting database, and I need the 5+ columns in my reporting tables to add up to a specific number, specifically 100%. I guess I could PIVOT a 3 column layout with ID, PercentGroup, Value but I would still need the column sections within each ID to add up to 100% before I PIVOT it.

Please consider this in your next development cycle
Back to top
View user's profile Send private message
andrew.evans



Joined: 17 Nov 2009
Posts: 1

PostPosted: Tue Nov 17, 2009 10:56 am    Post subject: Reply with quote

I'd also like to add my voice to get this included in the next release. I have a table that has a foreign key made up of two columns. This feature would enable me to populate the child table correctly and maintain the relationship.
Back to top
View user's profile Send private message
fdivis



Joined: 12 Dec 2006
Posts: 5

PostPosted: Mon Jan 11, 2010 1:33 pm    Post subject: Reply with quote

This feature would certainly be necessary. Especially in databases with moderate to high complexity where interdependency between tables is daily business.
The absence of the feature is one reason why the application is not in use here.
Back to top
View user's profile Send private message
fatherjack



Joined: 13 Mar 2007
Posts: 224
Location: Cornwall

PostPosted: Wed Jan 20, 2010 3:04 pm    Post subject: Reply with quote

I have a similar issue.

In my table I have colA and colB, colA MUST be 1 if ColB has any value in it, otherwise colA should be 0. I cannot seem to get Data Generator to insert any rows, it just returns an error saying the INSERT conflivted with a check constraint.

In the UI I have colA set to bit, no nulls and colB to description allow nulls. I have the "when data is invalid" option set to "skip row".

Why do no rows get inserted? surely some rows must be generated that are colA=1, colB='Some text'??
_________________
-----------------------------------------
Senior DBA
Careers South West Ltd
Back to top
View user's profile Send private message
stevefromoz



Joined: 14 Jun 2010
Posts: 1

PostPosted: Mon Jun 14, 2010 10:13 pm    Post subject: Reply with quote

Would like ot add my voice to the calls for this feature to be added.

My use case:

have a field with a numeric value (say Cost) and a second also numeric (say Price). Would like the ability to do the equivalent of

Price expression == $[Cost] * 1.8

or the reverse Smile
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