M$ SQL Random number# Database - 数据库
a*t
1 楼
I am using RAND() in a loop and it is giving the same numbers
Is it because the loop executes too fast and RAND() uses system time as seed?
I've tried to use the loop counter as seed but that doesn't help
if I use "waitfor delay 00:00:01" than I get different random numbers....
but it's not pratical because it'll take days to run what I want to do...
How do I get RAND() to work correctly in a loop?
Is it because the loop executes too fast and RAND() uses system time as seed?
I've tried to use the loop counter as seed but that doesn't help
if I use "waitfor delay 00:00:01" than I get different random numbers....
but it's not pratical because it'll take days to run what I want to do...
How do I get RAND() to work correctly in a loop?