Red Gate forums :: View topic - Putting values in a SQL Matrix.- it has a compound key
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

Putting values in a SQL Matrix.- it has a compound key

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



Joined: 16 Aug 2006
Posts: 57
Location: Cavendish

PostPosted: Thu Nov 06, 2008 1:05 pm    Post subject: Putting values in a SQL Matrix.- it has a compound key Reply with quote

I create a table....

create table matrix (x int not null,y int not null,element numeric(18,2) not null PRIMARY KEY (x,y))

I want to populate it with values for a matrix of 15(x) by 15(y). This would mean I'd want all unique combinations OF x AND y up to 15 in each case. I don't seem to be able to do it with SQL Data Generator.

Compound keys consist of several columns, in which all values are known (not null) and, in combination, are unique.
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6580

PostPosted: Tue Dec 30, 2008 1:49 pm    Post subject: Reply with quote

Hi Andrew,

I'd like to know what problem you run into. When I use your table, I set the table settings so that 15 rows are generated and when data is invalid, to skip the row. The downside is I always end up with very predictable data:
x y
1 1
2 2
3 3
... ...
Changing the column settings for x and y to use a range between 1 and 15 and randomizing generates more realism:
x y
1 9
2 3
4 11
... ...
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