DECLARE @Lenght INT = 6
DECLARE @OutPut VARCHAR(10) = ''
DECLARE @ExcludeList VARCHAR(100) = '~`!@#$%^&*()_-+={[}]|\:;"''?/>.<,'
DECLARE @CharList CHAR
WHILE (@Lenght >0)
BEGINSET @CharList = CHAR(RAND() * 72 + 48)
IF CHARINDEX(@CharList,@ExcludeList) = 0
BEGIN
SELECT @OutPut = @OutPut + @CharList
SET @Lenght = @Lenght - 1
END
END
SELECT UPPER(@OutPut)
No comments:
Post a Comment