SQL Generate Random Integer

DECLARE @MinValue INT, @MaxValue INTSET @MinValue = 1SET @MaxValue = 360SELECT ROUND(((@MaxValue - @MinValue -1) * RAND() + @MinValue), 0) or ABS(CHECKSUM(NEWID())) % @MaxValue + @MinValue

Leave a Reply

Your email address will not be published. Required fields are marked *