I want to update driver position fields (pos_x and pos_y) with random numbers
You can do this quite easily by simply using SQL.
UPDATE Person SET Pos_X = ABS(CHECKSUM(NEWID())) % 1000 , Pos_Y = ABS(CHECKSUM(NEWID())) % 1000
As all this is done on the SQL server, this means that you will not carry data about the delivery of network overhead data back and forth. Of course, after that you will need to choose the result to work.
Why is ABS-CHECKSUM-NEWID? I tried this with the T-SQL RAND () function with less satisfactory results !
Stephen turner
source share