3:将IP地点段转成每三位用点号分隔
createfunctiongetIP(@avarchar(15))
returnsvarchar(15)
As
begin
declare@svarchar(15)
set@s=
whilecharindex(.,@a)>0
begin
set@s=@s+right(000+left(@a,charindex(.,@a)),4)
set@a=right(@a,len(@a)-charindex(.,@a))
end
set@s=@s+right(000+@a,3)
return@s
end