| Author |
Message |
AndrewRMClarke
Joined: 16 Aug 2006 Posts: 55 Location: Cavendish
|
Posted: Thu Nov 06, 2008 1:05 pm Post subject: Putting values in a SQL Matrix.- it has a compound key |
|
|
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 |
|
 |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6344 Location: Red Gate Software
|
Posted: Tue Dec 30, 2008 1:49 pm Post subject: |
|
|
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
... ... _________________ Brian Donahue
Technical Support
Red Gate Software Ltd.
44 (0)870 160 0037 ext 8521
US and CAN 1-866-RED GATE ext 8521 |
|
| Back to top |
|
 |
|
|
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