title: Random numbers from database
body: <p><strong>EDIT</strong>: Duplicate of <a href="https://stackoverflow.com/questions/94906/how-do-i-return-random-numbers-as-a-column-in-sql-server-2005">How do I return random numbers as a column in SQL Server 2005?</a></p>
  
  <p>Hello 
  How can I generate random numbers in mssql server 2005.</p>
  
  <p>for example: when I select 500rows from table, each row must have one generated random number, numbers must be generated at runtime</p>
  
  <p>UPDATE: I need the fastest method, generate numbers from large tables, datepart, same magic computations is realatively slow with big amount of rows</p>
  
  <p>UPDATE thanks for answers, but o finally used this solution </p>
  
  <pre><code>SELECT ABS(CHECKSUM(NewId())) % 10 - 5 AS Random
  </code></pre>
  
  <p>for random numbers from -5 to 5 and bonus is approximately the same number of occurances for each number</p>