--Random Row Number Generation in SQL Server.
declare @mod_bounds int
set @mod_bounds = 1000
select abs(cast(CAST(NEWID() AS varbinary) as int))%@mod_bounds
--This will give us a random number between 0 and 999
--If this casting is done on a select statement, the result will change per row.