MSSQL stored procedure generate random string

USE [xxxx]
GO
/****** Object:  StoredProcedure [dbo].[GenSN] ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER proc [dbo].[GenSN]
    @len int,
    @min tinyint = 48,
    @range tinyint = 74,
    @exclude varchar(50) = '012oOiIlZ:;<=>?@[]`^\/_',
    @output varchar(50) output
as 
    declare @char char
    set @output = ''
 
    while @len > 0 begin
       select @char = char(round(rand() * @range + @min, 0))
       if charindex(@char, @exclude) = 0 begin
           set @output += @char
           set @len = @len - 1
       end
    end
;


/****** call sp ******/
DECLARE	@return_value int,
		@output varchar(50),
		@_i INT,
		@_max INT

SET @_i = 0
Set @_max = 110000
WHILE(@_i<@_max)
	BEGIN
	EXEC	@return_value = [dbo].[GenSN]
			@len = 8,
			@output = @output OUTPUT

	Insert into sn (serial_no) values(@output)
	
	SET @_i=@_i+1
END