declare @code char(5) --자리수
set @code = (
select c1 as [text()]
FROM (
select top(5) c1 -- 자리수
FROM (
VALUES
('A'), ('B'), ('C'), ('D'), ('E'), ('F'), ('G'), ('H'), ('I'), ('J'),
('K'), ('L'), ('M'), ('N'), ('O'), ('P'), ('Q'), ('R'), ('S'), ('T'),
('U'), ('V'), ('W'), ('X'), ('Y'), ('Z'), ('0'), ('1'), ('2'), ('3'),
('4'), ('5'), ('6'), ('7'), ('8'), ('9')
) AS T1(c1)
ORDER BY ABS(CHECKSUM(NEWID()))
) AS T2
FOR XML PATH('')
);
select @code
출처 : 아.. 외국사이트였는데.. 기억이.. 기억이..ㅠ.ㅠ
댓글 영역