--M1非接触式射频存储卡卡唯一号(十六进制值表示),去除其前部为0的自定义函数
Create FUNCTION dbo.f_header_zero_delete(@s varchar(8))
RETURNS varchar(8)
AS
BEGIN
declare @i int,@ss varchar(8)
select @i=(case when substring(@s,1,1)<>'0' then 1
when substring(@s,2,1)<>'0' then 2
when substring(@s,3,1)<>'0' then 3
when substring(@s,4,1)<>'0' then 4
when substring(@s,5,1)<>'0' then 5
when substring(@s,6,1)<>'0' then 6
when substring(@s,7,1)<>'0' then 7
when substring(@s,8,1)<>'0' then 8 else 0 end)
select @ss=substring(@s,@i,8-@i+1)
return @ss
END