日期:2014-05-18 浏览次数:20360 次
Declare @str varchar(50),@result varchar(50) set @str='414243313233344B4A' select @result=isnull(@result,'')+ char(left(col,1)*16 +case when isnumeric(right(col,1))=0 then ascii(right(col,1))-55 else right(col,1) end ) from( select substring(@str,number*2+1,2) as col from master..spt_values where type='P' and number<len(@str)/2 ) t select @result as result /** result -------------------------------------------------- ABC1234KJ (1 行受影响) **/