DECLARE @exclude varchar(50) SET @exclude = ':;<=>?@O[]`^...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Biology Meta

Q&A about the site for biology researchers, academics, and students

DECLARE @exclude varchar(50) 
    SET @exclude = ':;<=>?@O[]`^\/'
    DECLARE @char char
    DECLARE @len char
    DECLARE @output varchar(50)
    set @output = ''
    set @len = 6

    while @len > 0 begin
       select @char = char(round(rand() * 74 + 48, 0))
       if charindex(@char, @exclude) = 0 begin
           set @output = @output + @char
           set @len = @len - 1
       end
    end

   SELECT @output

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results