| Author |
Topic  |
|
|
helixpoint
Constraint Violating Yak Guru
250 Posts |
Posted - 02/07/2013 : 08:08:02
|
I need to insert into a field for testing, but the field has a contraint on an ID from abother field. I want to do un update with a random number between 2 defined numbers like 21 and 61??
Dave Helixpoint Web Development http://www.helixpoint.com |
|
|
helixpoint
Constraint Violating Yak Guru
250 Posts |
Posted - 02/07/2013 : 08:38:58
|
Got it Declare @maxRandomValue tinyint = 15 , @minRandomValue tinyint = 29;
UPDATE tblTrkRecord SET SubStatusId = (SELECT CAST((@maxRandomValue + 1 - @minRandomValue) * RAND() + @minRandomValue AS tinyint) AS Expr1) WHERE (StatusId = 7)
Dave Helixpoint Web Development http://www.helixpoint.com |
 |
|
|
Lamprey
Flowing Fount of Yak Knowledge
3821 Posts |
|
|
madhivanan
Premature Yak Congratulator
India
22460 Posts |
|
| |
Topic  |
|