GO SET QUOTED_IDENTIFIER OFF GO SET ANSI_NULLS ON GO
SET QUOTED_IDENTIFIER OFF GO SET ANSI_NULLS ON GO
CREATE proc dbo.proc_GetValidCode_Internal --取得校验码 @CodeLength integer, @ValidCode varchar(10) output as set nocount on
declare @chrRnd char(1) declare @chrRndNo integer
begin
select @ValidCode=""
while (@CodeLength>0) begin exec proc_GetRandom_internal 1,52,@chrRndNo output if @chrRndNo>26 begin select @chrRndNo=@chrRndNo+6 end select @chrRnd=char(@chrRndNo+64) select @ValidCode=@ValidCode+@chrRnd select @CodeLength=@CodeLength-1 end print @validCode return end
GO SET QUOTED_IDENTIFIER OFF GO SET ANSI_NULLS ON GO