Viewing 4 posts - 1 through 4 (of 4 total)
Jeff Moden (5/10/2016)
Heh... absolutely correct. It doesn't happen often but it does happen.
Scientists have calculated that the chance of anything so patently absurd actually existing are millions...
May 11, 2016 at 3:42 am
Sioban Krzywicki (5/9/2016)
I'd rather do this
SELECT (ABS(CAST(CHECKSUM(NewID()) AS bigint)) %20) + 1
than divide by 10. Matter of preference, really.
Also correct, but to get value from range <1,20> you cast it...
May 10, 2016 at 12:17 am
Sioban Krzywicki (5/9/2016)
SELECT (ABS(CHECKSUM(NEWID())) %20) + 1
This generates random numbers between 1 and 20. To have...
May 9, 2016 at 7:27 am
SELECT *
FROM Person.StateProvince
WHERE (ABS(CAST((BINARY_CHECKSUM(*) * RAND()) AS INT)) % 100) < 10
What happens if CAST((BINARY_CHECKSUM(*) * RAND()) AS INT = - 2^31 ?
Int Range is <-2 147 483...
May 9, 2016 at 1:18 am
Viewing 4 posts - 1 through 4 (of 4 total)