--create
-- 去掉特殊符号
alter function RepSymbol(@str nvarchar(max))
returns nvarchar(max)
as
begin

set @str=LTRIM(@str)
set @str=RTRIM(@str)
set @str=replace(@str,char(9),'') --水平制表符
set @str=replace(@str,char(10),'') -- 换行
set @str=replace(@str,char(13),'') --回车
set @str = replace(@str,'π', 'π');
set @str = replace(@str,'∠', '∠');
set @str = replace(@str,'≠', '≠');
set @str = replace(@str,'≥', '≥');
set @str = replace(@str,'≤', '≤');
set @str = replace(@str,'α', 'α');
set @str = replace(@str,'|', '|');
set @str = replace(@str,'±', '±');
set @str = replace(@str,'∞', '∞');
set @str = replace(@str,'×', '×');
set @str = replace(@str,'$', '$');
set @str = replace(@str,''', '''');
set @str = replace(@str,'°','°');
set @str = replace(@str,'⊥','⊥');
set @str = replace(@str,'∪','∪');
set @str = replace(@str,' ',' ');
set @str = replace(@str,'&lt;','<');
set @str = replace(@str,'&isin;','”');
set @str = replace(@str,'&beta;','β');
set @str = replace(@str,'濛','濛');
set @str = replace(@str,'&ldquo;','“');
set @str = replace(@str,'&prime;','′');
set @str = replace(@str,'&Delta;','Δ');
set @str = replace(@str,'&middot;','·');
set @str = replace(@str,'&gt;','>');
set @str = replace(@str,'&darr;','↓');
set @str = replace(@str,'&rarr;','→');
set @str = replace(@str,'&bull;','•');
set @str = replace(@str,'&rdquo;','”');
set @str = replace(@str,'&omega;','ω');
set @str = replace(@str,'&shy;','');
set @str = replace(@str,'&uarr;','↑');
set @str = replace(@str,'&theta;','θ');
set @str = replace(@str,'&mdash;','—');
set @str = replace(@str,'—','—');
set @str = replace(@str,'&#36','$');
set @str = replace(@str,'▽','▽');
set @str = replace(@str,'&there4;','∴');
set @str = replace(@str,'⊕','⊕');
set @str = replace(@str,'&zeta;','ζ');
set @str = replace(@str,' ','');
set @str = replace(@str,'&cap;','∩');
set @str = replace(@str,'&hellip;','…');
set @str = replace(@str,'砳','砳');
set @str = replace(@str,'&rho;','ρ');
set @str = replace(@str,'&divide;','÷');
set @str = replace(@str,'&gamma;','γ');
set @str = replace(@str,'≥','≥');
set @str = replace(@str,'·','·');
set @str = replace(@str,'&#39','''');
set @str = replace(@str,'&quot;','"');

set @str=replace(@str,'&forall;','∀');
set @str=replace(@str,'&part;','∂');
set @str=replace(@str,'&empty;','∅');
set @str=replace(@str,'&nabla;','∇');
set @str=replace(@str,'&isin;','∈');
set @str=replace(@str,'&notin;','∉');
set @str=replace(@str,'&ni;','∋');
set @str=replace(@str,'&prod;','∏');
set @str=replace(@str,'&sum;','∑');
set @str=replace(@str,'&minus;','−');
set @str=replace(@str,'&lowast;','∗');
set @str=replace(@str,'&radic;','√');
set @str=replace(@str,'&prop;','∝');
set @str=replace(@str,'&infin;','∞');
set @str=replace(@str,'&ang;','∠');
set @str=replace(@str,'&and;','∧');
set @str=replace(@str,'&or;','∨');
set @str=replace(@str,'&cap;','∩');
set @str=replace(@str,'&cup;','∪');
set @str=replace(@str,'&int;','∫');
set @str=replace(@str,'&there4;','∴');
set @str=replace(@str,'&sim;','∼');
set @str=replace(@str,'&cong;','≅');
set @str=replace(@str,'&asymp;','≈');
set @str=replace(@str,'&ne;','≠');
set @str=replace(@str,'&equiv;','≡');
set @str=replace(@str,'&le;','≤');
set @str=replace(@str,'&ge;','≥');
set @str=replace(@str,'&sub;','⊂');
set @str=replace(@str,'&sup;','⊃');
set @str=replace(@str,'&nsub;','⊄');
set @str=replace(@str,'&sube;','⊆');
set @str=replace(@str,'&supe;','⊇');
set @str=replace(@str,'&oplus;','⊕');
set @str=replace(@str,'&otimes;','⊗');
set @str=replace(@str,'&perp;','⊥');
set @str=replace(@str,'&sdot;','⋅');
set @str=replace(@str,'&Alpha;','Α');
set @str=replace(@str,'&Beta;','Β');
set @str=replace(@str,'&Gamma;','Γ');
set @str=replace(@str,'&Delta;','Δ');
set @str=replace(@str,'&Epsilon;','Ε');
set @str=replace(@str,'&Zeta;','Ζ');
set @str=replace(@str,'&Eta;','Η');
set @str=replace(@str,'&Theta;','Θ');
set @str=replace(@str,'&Iota;','Ι');
set @str=replace(@str,'&Kappa;','Κ');
set @str=replace(@str,'&Lambda;','Λ');
set @str=replace(@str,'&Mu;','Μ');
set @str=replace(@str,'&Nu;','Ν');
set @str=replace(@str,'&Xi;','Ξ');
set @str=replace(@str,'&Omicron;','Ο');
set @str=replace(@str,'&Pi;','Π');
set @str=replace(@str,'&Rho;','Ρ');
set @str=replace(@str,'&Sigma;','Σ');
set @str=replace(@str,'&Tau;','Τ');
set @str=replace(@str,'&Upsilon;','Υ');
set @str=replace(@str,'&Phi;','Φ');
set @str=replace(@str,'&Chi;','Χ');
set @str=replace(@str,'&Psi;','Ψ');
set @str=replace(@str,'&Omega;','Ω');
set @str=replace(@str,'&alpha;','α');
set @str=replace(@str,'&beta;','β');
set @str=replace(@str,'&gamma;','γ');
set @str=replace(@str,'&delta;','δ');
set @str=replace(@str,'&epsilon;','ε');
set @str=replace(@str,'&zeta;','ζ');
set @str=replace(@str,'&eta;','η');
set @str=replace(@str,'&theta;','θ');
set @str=replace(@str,'&iota;','ι');
set @str=replace(@str,'&kappa;','κ');
set @str=replace(@str,'&lambda;','λ');
set @str=replace(@str,'&mu;','μ');
set @str=replace(@str,'&nu;','ν');
set @str=replace(@str,'&xi;','ξ');
set @str=replace(@str,'&omicron;','ο');
set @str=replace(@str,'&pi;','π');
set @str=replace(@str,'&rho;','ρ');
set @str=replace(@str,'&sigmaf;','ς');
set @str=replace(@str,'&sigma;','σ');
set @str=replace(@str,'&tau;','τ');
set @str=replace(@str,'&upsilon;','υ');
set @str=replace(@str,'&phi;','φ');
set @str=replace(@str,'&chi;','χ');
set @str=replace(@str,'&psi;','ψ');
set @str=replace(@str,'&omega;','ω');
set @str=replace(@str,'&thetasym;','ϑ');
set @str=replace(@str,'&upsih;','ϒ');
set @str=replace(@str,'&piv;','ϖ');
set @str=replace(@str,'&OElig;','Œ');
set @str=replace(@str,'&oelig;','œ');
set @str=replace(@str,'&Scaron;','Š');
set @str=replace(@str,'&scaron;','š');
set @str=replace(@str,'&Yuml;','Ÿ');
set @str=replace(@str,'&fnof;','ƒ');
set @str=replace(@str,'&circ;','ˆ');
set @str=replace(@str,'&tilde;','˜');
set @str=replace(@str,'&ensp;','');
set @str=replace(@str,'&emsp;',' ');
set @str=replace(@str,'&thinsp;',' ');
set @str=replace(@str,'&zwnj;','‌');
set @str=replace(@str,'&zwj;','‍');
set @str=replace(@str,'&lrm;','‎');
set @str=replace(@str,'&rlm;','‏');
set @str=replace(@str,'&ndash;','–');
set @str=replace(@str,'&mdash;','—');
set @str=replace(@str,'&lsquo;','‘');
set @str=replace(@str,'&rsquo;','’');
set @str=replace(@str,'&sbquo;','‚');
set @str=replace(@str,'&ldquo;','“');
set @str=replace(@str,'&rdquo;','”');
set @str=replace(@str,'&bdquo;','„');
set @str=replace(@str,'&dagger;','†');
set @str=replace(@str,'&Dagger;','‡');
set @str=replace(@str,'&bull;','•');
set @str=replace(@str,'&hellip;','…');
set @str=replace(@str,'&permil;','‰');
set @str=replace(@str,'&prime;','′');
set @str=replace(@str,'&Prime;','″');
set @str=replace(@str,'&lsaquo;','‹');
set @str=replace(@str,'&rsaquo;','›');
set @str=replace(@str,'&oline;','‾');
set @str=replace(@str,'&euro;','€');
set @str=replace(@str,'&trade;','™');
set @str=replace(@str,'&larr;','←');
set @str=replace(@str,'&uarr;','↑');
set @str=replace(@str,'&rarr;','→');
set @str=replace(@str,'&darr;','↓');
set @str=replace(@str,'&harr;','↔');
set @str=replace(@str,'&crarr;','↵');
set @str=replace(@str,'&lceil;','⌈');
set @str=replace(@str,'&rceil;','⌉');
set @str=replace(@str,'&lfloor;','⌊');
set @str=replace(@str,'&rfloor;','⌋');
set @str=replace(@str,'&loz;','◊');
set @str=replace(@str,'&spades;','♠');
set @str=replace(@str,'&clubs;','♣');
set @str=replace(@str,'&hearts;','♥');
set @str=replace(@str,'&diams;','♦');
set @str=replace(@str,'∀','∀');

set @str=replace(@str,'∂','∂');
set @str=replace(@str,'∃','∃');
set @str=replace(@str,'∅','∅');
set @str=replace(@str,'∇','∇');
set @str=replace(@str,'∈','∈');
set @str=replace(@str,'∉','∉');
set @str=replace(@str,'∋','∋');
set @str=replace(@str,'∏','∏');
set @str=replace(@str,'∑','∑');
set @str=replace(@str,'−','−');
set @str=replace(@str,'∗','∗');
set @str=replace(@str,'√','√');
set @str=replace(@str,'∝','∝');
set @str=replace(@str,'∞','∞');
set @str=replace(@str,'∠','∠');
set @str=replace(@str,'∧','∧');
set @str=replace(@str,'∨','∨');
set @str=replace(@str,'∩','∩');
set @str=replace(@str,'∪','∪');
set @str=replace(@str,'∫','∫');
set @str=replace(@str,'∴','∴');
set @str=replace(@str,'∼','∼');
set @str=replace(@str,'≅','≅');
set @str=replace(@str,'≈','≈');
set @str=replace(@str,'≠','≠');
set @str=replace(@str,'≡','≡');
set @str=replace(@str,'≤','≤');
set @str=replace(@str,'≥','≥');
set @str=replace(@str,'⊂','⊂');
set @str=replace(@str,'⊃','⊃');
set @str=replace(@str,'⊄','⊄');
set @str=replace(@str,'⊆','⊆');
set @str=replace(@str,'⊇','⊇');
set @str=replace(@str,'⊕','⊕');
set @str=replace(@str,'⊗','⊗');
set @str=replace(@str,'⊥','⊥');
set @str=replace(@str,'⋅','⋅');
set @str=replace(@str,'Α','Α');
set @str=replace(@str,'Β','Β');
set @str=replace(@str,'Γ','Γ');
set @str=replace(@str,'Δ','Δ');
set @str=replace(@str,'Ε','Ε');
set @str=replace(@str,'Ζ','Ζ');
set @str=replace(@str,'Η','Η');
set @str=replace(@str,'Θ','Θ');
set @str=replace(@str,'Ι','Ι');
set @str=replace(@str,'Κ','Κ');
set @str=replace(@str,'Λ','Λ');
set @str=replace(@str,'Μ','Μ');
set @str=replace(@str,'Ν','Ν');
set @str=replace(@str,'Ξ','Ξ');
set @str=replace(@str,'Ο','Ο');
set @str=replace(@str,'Π','Π');
set @str=replace(@str,'Ρ','Ρ');
set @str=replace(@str,'Σ','Σ');
set @str=replace(@str,'Τ','Τ');
set @str=replace(@str,'Υ','Υ');
set @str=replace(@str,'Φ','Φ');
set @str=replace(@str,'Χ','Χ');
set @str=replace(@str,'Ψ','Ψ');
set @str=replace(@str,'Ω','Ω');
set @str=replace(@str,'α','α');
set @str=replace(@str,'β','β');
set @str=replace(@str,'γ','γ');
set @str=replace(@str,'δ','δ');
set @str=replace(@str,'ε','ε');
set @str=replace(@str,'ζ','ζ');
set @str=replace(@str,'η','η');
set @str=replace(@str,'θ','θ');
set @str=replace(@str,'ι','ι');
set @str=replace(@str,'κ','κ');
set @str=replace(@str,'Λ','λ');
set @str=replace(@str,'μ','μ');
set @str=replace(@str,'Ν','ν');
set @str=replace(@str,'ξ','ξ');
set @str=replace(@str,'ο','ο');
set @str=replace(@str,'π','π');
set @str=replace(@str,'ρ','ρ');
set @str=replace(@str,'ς','ς');
set @str=replace(@str,'σ','σ');
set @str=replace(@str,'τ','τ');
set @str=replace(@str,'υ','υ');
set @str=replace(@str,'φ','φ');
set @str=replace(@str,'χ','χ');
set @str=replace(@str,'ψ','ψ');
set @str=replace(@str,'ω','ω');
set @str=replace(@str,'ϑ','ϑ');
set @str=replace(@str,'ϒ','ϒ');
set @str=replace(@str,'ϖ','ϖ');
set @str=replace(@str,'Œ','Œ');
set @str=replace(@str,'œ','œ');
set @str=replace(@str,'Š','Š');
set @str=replace(@str,'š','š');
set @str=replace(@str,'Ÿ','Ÿ');
set @str=replace(@str,'ƒ','ƒ');
set @str=replace(@str,'ˆ','ˆ');
set @str=replace(@str,'˜','˜');
set @str=replace(@str,' ','');
set @str=replace(@str,' ','');
set @str=replace(@str,' ',' ');
set @str=replace(@str,'‌','‌');
set @str=replace(@str,'‍','‍');
set @str=replace(@str,'‎','‎');
set @str=replace(@str,'‏','‏');
set @str=replace(@str,'–','–');
set @str=replace(@str,'—','—');
set @str=replace(@str,'‘','‘');
set @str=replace(@str,'’','’');
set @str=replace(@str,'‚','‚');
set @str=replace(@str,'“','“');
set @str=replace(@str,'”','”');
set @str=replace(@str,'„','„');
set @str=replace(@str,'†','†');
set @str=replace(@str,'‡','‡');
set @str=replace(@str,'•','•');
set @str=replace(@str,'…','…');
set @str=replace(@str,'‰','‰');
set @str=replace(@str,'′','′');
set @str=replace(@str,'″','″');
set @str=replace(@str,'‹','‹');
set @str=replace(@str,'›','›');
set @str=replace(@str,'‾','‾');
set @str=replace(@str,'€','€');
set @str=replace(@str,'™','™');
set @str=replace(@str,'←','←');
set @str=replace(@str,'↑','↑');
set @str=replace(@str,'→','→');
set @str=replace(@str,'↓','↓');
set @str=replace(@str,'↔','↔');
set @str=replace(@str,'↵','↵');
set @str=replace(@str,'⌈','⌈');
set @str=replace(@str,'⌉','⌉');
set @str=replace(@str,'⌊','⌊');
set @str=replace(@str,'⌋','⌋');
set @str=replace(@str,'◊','◊');
set @str=replace(@str,'♠','♠');
set @str=replace(@str,'♣','♣');
set @str=replace(@str,'♥','♥');
set @str=replace(@str,'♦','♦');

return @str
end
go

sql server 替换特殊符号的更多相关文章

  1. Oracle Select into 用Sql server替换

    --Oracle: DECLARE n_count int; begin Select count(*) into n_count from from M_Test where ENTITYLSH = ...

  2. SQL Server替换特殊字符

    1.查找特殊字符的ASCII码,在这里当然能够看到这个特出字符的模样,可用函数取出这个特殊字符进行复制,下面的取值为9 Select ascii(' ') 2.根据ASCII码值替换特殊字符 Upda ...

  3. SQL Server:替换文本中的回车和换行符

    --替换回车符 update master_locationSET street_number = REPLACE(street_number, CHAR(13), '') --替换换行符 updat ...

  4. sql server替换字段中的某个字符

    USE [Vocabulary ] GO --UPDATE [dbo].[table name] --   SET [en] = '' --      ,[cn] ='' -- WHERE --cha ...

  5. sql server 数据字符串替换函数

    sql server 替换函数 replace 函数参数 REPLACE(string_expression, string_pattern, string_replacement) 1.string ...

  6. SQL Server查询中特殊字符的处理方法 (SQL Server特殊符号的转义处理)

    SQL Server查询中特殊字符的处理方法 (SQL Server特殊符号的转义处理) SQL Server查询中,经常会遇到一些特殊字符,比如单引号'等,这些字符的处理方法,是SQL Server ...

  7. SQL Server中批量替换数据

    SQL Server数据库中批量替换数据的方法 SQL Server数据库操作中,我们可能会根据某写需要去批量替换数据,那么如何批量修改替换数据呢?本文我们就介绍这一部分内容,接下来就让我们一起来了解 ...

  8. SQL SERVER将某一列字段中的某个值替换为其他的值 分类: MSSQL 2014-11-05 13:11 67人阅读 评论(0) 收藏

    SQL SERVER将某一列字段中的某个值替换为其他的值 UPDATE 表名 SET 列名 = REPLACE(列名 ,'贷','袋') SQL SERVER"函数 replace 的参数 ...

  9. SQL Server 2005,2008 正则表达式 替换函数应用详解

    CREATE function dbo.regexReplace ( @source ntext, --原字符串 ), --正则表达式 ), --替换值 , --是否是全局替换 --是否忽略大小写 ) ...

随机推荐

  1. 隐藏UITableView多余的分割线

    先看看没有隐藏是什么效果以及代码是什么情况,这样更加直观

  2. WIN32服务程序(三):完整的服务程序实例

    前面我们所讲的“服务程序”,更准确地说是服务控制程序,例如我们通过输入应用的路径,将一个应用程序添加到服务控制管理器.一个服务控制程序可以将一个程序添加到服务控制管理器中,并控制它的运行.停止和删除等 ...

  3. LintCode Two Strings Are Anagrams

    1. 把string变为char数组 2. 排序Arrays.sort() public class Solution { /** * @param s: The first string * @pa ...

  4. 如何配置Windows 防火墙,允许SQL Server的远程连接

    一.如何找到SQL Server正在侦听的TCP端口,可以按一下步骤: 1.打开 SQL Server 配置管理器中,从开始->所有程序-> Microsoft SQL Server 20 ...

  5. URL Scheme APP跳转safari以及跳回APP

    上图 : 在plist文件里面设置. URL identifier 一般为反域名+项目名称 (尽可能保证少重复) URL Schemes是一个数组.一个APP可以添加多个.该参数为跳转时使用的标识. ...

  6. pyspider 简单应用之快速问医生药品抓取(一)

    网址:http://yp.120ask.com/search/-0-0--0-0-0-0.html from pyspider.libs.base_handler import * class Han ...

  7. android之animation

    Android  Animation一共有四种 Alpha: 淡入淡出效果 Scale: 缩放效果 Rotate: 旋转效果 Translate:移动效果 使用Tweened Animations的步 ...

  8. Ecstore会员密码加密方式破解

    <?php //以下是加密方式,亲测有效 $string_md5 = md5(md5("密码")."用户名"."注册时间");//三个 ...

  9. Qt and C++ Reflection,利用Qt简化C++的反射实现

    如何在C++中实现反射机制,应该算是C++开发中经常遇到的问题之一.C++程序没有完整的元数据,也就无法实现原生的反射机制.从性能的角度讲,这样的设计不难理解,毕竟在运行时储存这些元数据需要额外的开销 ...

  10. SQL Server Profiler

    一.SQL Profiler工具简介 SQL Profiler是一个图形界面和一组系统存储过程,其作用如下: 图形化监视SQL Server查询: 在后台收集查询信息: 分析性能: 诊断像死锁之类的问 ...