汉字|数据|数据库
删除汉字:
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 @Result=@Result+SUBSTRING(@cargoname,@sno, 1)
set @sno=@sno+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 @Result=@Result+SUBSTRING(@cargoname,@sno, 1)
set @sno=@sno+1
end
RETURN(@Result)
END