i want my function to generate float numbers ( like : -123.000 , 874.000 ) in range ( like between: 272 and 3357 ) and update every record’s “pos_x” field with unique float numbers.
I write this Code but i see my table’s field are all identical and also integer and they are positive.
this is my code :
UPDATE Driver_tbl
SET pos_x = (ROUND((RAND()* 10000),0))
RAND is evaluated once per query
You can seed it like this though using
CHECKSUM(NEWID())so it is random per rowHowever, you can also cut out the middle man if you are using ROUND(.., 0)