everytime you reload your script, you will get a different random number (hence the name). i use rand all the time and its hard to test esp if you need to reload multiple times. what i do is rt after the table with the rand() number fields, i save it to a QVD and next time just load the QVD and comment out the table itself.
obviously, you need to change your script after the first run. if manually changing the script is not acceptable, then you can automate it by first checking if the QVD exists, if so, load it else run the code that has the rand() and then save to QVD.