DECLARE @Random INT; DECLARE @Upper INT; DECLARE @Lower INT SET @Lower = 100 ---- The lowest random number SET @Upper = 999 ---- The highest random number SELECT @Random = ROUND(((@Upper - @Lower -1) * RAND() + @Lower), 0) SELECT @Random
http://blog.sqlauthority.com/2007/04/29/sql-server-random-number-generator-script-sql-query/
0 comments:
Post a Comment