【问】上传下载报错,会员信息中有非法字符和全角半角标点符号? | ||
【适用版本】服装之星8 | 【模块】基础业务 | 【点击数】164 |
【知识编号】Z2012122400017 | ||
【问题描述】上传下载报错,会员信息中有非法字符和全角半角标点符号? |
use hbfsv8 –分店请用hbfsv8_branch 代替hbfsv8
go
if object_id(N’u_convert’,N’FN’) is not null
drop function u_convert
GO
create function u_convert(
@str nvarchar(4000),
@flag bit
)
returns nvarchar(4000)
AS
begin
declare
@pat nvarchar(8),
@step int,
@i int,
@spc int
if @flag=0
begin
select @pat=N’%[!-~]%’,@step=-65248,
@str=replace(@str,N’ ’,N’ ‘)
end
else
begin
select @pat=N’%[!-~]%’,@step=65248,
@str=replace(@str,N’ ‘,N’ ’)
end
set @i=patindex(@pat collate LATIN1_GENERAL_BIN,@str)
while @i>0
select @str=replace(@str,substring( @str,@i,1), nchar(unicode(substring(@str,@i,1))+@step)),@i=patindex(@pat collate LATIN1_GENERAL_BIN,@str)
return(@str)
end
GO
update t_rm_vip_consume set card_id = dbo.u_convert(card_id,0)
go
update t_rm_vip_info set card_id = dbo.u_convert(card_id,0)