DECLARE @Result int SET @Result = CONVERT(int, 1 + 10000*RAND(CHECKSUM(NEWID())))
RETURN @Result
Tags:
SQL Server