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

Amit Singh

Total Post:562

Points:2810
Posted by  Amit Singh
 2054  View(s)
Ratings:
Rate this:
  1. Amit Singh

    Post:562

    Points:2810
    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);

      Modified On Mar-26-2018 05:47:33 AM

Answer

NEWSLETTER

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