asked on
SELECT * FROM table
ORDER BY NEWID()
--1 to 6
ABS(Checksum(NewID()) % 5) + 1
-- 20 to 40
ABS(Checksum(NewID()) % 40) + 20
ASKER
Microsoft SQL Server is a suite of relational database management system (RDBMS) products providing multi-user database access functionality.SQL Server is available in multiple versions, typically identified by release year, and versions are subdivided into editions to distinguish between product functionality. Component services include integration (SSIS), reporting (SSRS), analysis (SSAS), data quality, master data, T-SQL and performance tuning.
TRUSTED BY
http://msdn.microsoft.com/en-us/library/e9zc0283%28v=vs.80%29.aspx
You might be able to do
SELECT RAND(1000) AS randomnumber.... ORDER BY randomnumber
but I haven't tried that. Calling it that way may just reseed it each time and not provide a random number.
http://technet.microsoft.com/en-us/library/ms177610.aspx