Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
landau66
Yak Posting Veteran
61 Posts |
Posted - 2007-12-17 : 08:02:45
|
| Hi all!I have a table with three columns: Identity, DateTime (current_timestamp) and one which I want to fill with random values always depending on the value in the same column one row above.Since I want it to be a stored procedure I have to pass three parameters - an initial value, the range within the random number is higher or lower than the number in the preceding row and the number of rows which should be inserted. This means that as soon as a new row is inserted there is also a new seed for the random value for the next line.My problem now is that I would always get out the same number. Maybe you know a solution for my problem. Many thanks and greetings from AustriaLandau |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-12-17 : 08:05:06
|
ABS(CHECKSUM(NEWID())) % MaxNumber E 12°55'05.25"N 56°04'39.16" |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|