--create function f_GB2BIG(
@str nvarchar(4000), --要转换的字符串
@toBIG bit --转换标志,为1,表示 GB-->BIG,否则是 BIG-->GB
)returns nvarchar(4000)
as
begin
if @toBIG=1
select @str=replace(@str,gb,big)
from codetable
where charindex(gb,@str)>0
else
select @str=replace(@str,big,gb)
from codetable
where charindex(big,@str)>0
return(@str)
end
go