HOW TO USE FUNCTION TO GENERATE RAND NUMBER IN MSSQL SERVER?

Amit Singh

Total Post:565

Points:2825
Posted by  Amit Singh
 1956  View(s)
Ratings:
Rate this:
  1. Amit Singh

    Post:565

    Points:2825
    how to use function to generate rand number in mssql server?

    we use rand function in sql server to generate random number

    * RAND(seed) - Starting a new sequence of random numbers based on the given integer "seed" and returning the first random number in FLOAT(53) from the sequence.
    * RAND() - Returning the next random number in FLOAT(53) from the current sequence. If there has been no current sequence, SQL Server will start a new sequence with a random "seed".

    for example:
    SELECT RAND(100);

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!