删除汉字:
create function deletehz (@cargoname varchar(512))
returns varchar(512)
as
begin
declare @result varchar(512)
declare @sno smallint
select @result=''
select @sno=1
while(@sno<=datalength(@cargoname))
begin
if datalength(substring(@cargoname,@sno, 1))=1
set @[email protected]+substring(@cargoname,@sno, 1)
set @[email protected]+1
end
return(@result)
end
删除字符:
create function deleteen (@cargoname varchar(512))
returns varchar(512)
as
begin
declare @result varchar(512)
declare @sno smallint
select @result=''
select @sno=1
while(@sno<=datalength(@cargoname))
begin
if datalength(substring(@cargoname,@sno, 1))=2
set @[email protected]+substring(@cargoname,@sno, 1)
set @[email protected]+1
end
return(@result)
end
新闻热点
疑难解答