Generate random numbers per row with NEWID or CRYPT_GEN_RANDOM, compare seeded RAND, inspect bucket spread, and pick a row without a sort.
Picking Random Winners Fairly With NEWID and CRYPT_GEN_RANDOM
Pick random winners with NEWID or cryptographic randomness, handle weights and unique entrants, and save a draw with its seed and timestamp.
SQL SERVER – Generate A Single Random Number for Range of Rows of Any Table – Very interesting Question from Reader
A reader asked how to get a single random number for a set of rows, like one per PostalCode. I compare NEWID() for each row with RAND() for a whole set.
SQL SERVER – 2005 Limiting Result Sets by Using TABLESAMPLE – Examples
TABLESAMPLE returns a random sample of rows by percent or row count. My examples show why the same query returns a different number of rows each time.
A Quote of the Day From a Table, With No Repeats Until All Are Used
Build a quote of the day table that rotates without repeats, handles concurrent requests, and supports a stable date-based selection.
SQL SERVER – Random Number Generator Script – SQL Query
A random number generator in SQL Server needs the correct range and evaluation scope. These tested scripts cover integer bounds, repeatable seeds, per-row values, and common overflow mistakes.






