sql server 替换特殊符号
--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,'<','<');
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,'—','—');
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,'—','—');
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 替换特殊符号的更多相关文章
- Oracle Select into 用Sql server替换
--Oracle: DECLARE n_count int; begin Select count(*) into n_count from from M_Test where ENTITYLSH = ...
- SQL Server替换特殊字符
1.查找特殊字符的ASCII码,在这里当然能够看到这个特出字符的模样,可用函数取出这个特殊字符进行复制,下面的取值为9 Select ascii(' ') 2.根据ASCII码值替换特殊字符 Upda ...
- SQL Server:替换文本中的回车和换行符
--替换回车符 update master_locationSET street_number = REPLACE(street_number, CHAR(13), '') --替换换行符 updat ...
- sql server替换字段中的某个字符
USE [Vocabulary ] GO --UPDATE [dbo].[table name] -- SET [en] = '' -- ,[cn] ='' -- WHERE --cha ...
- sql server 数据字符串替换函数
sql server 替换函数 replace 函数参数 REPLACE(string_expression, string_pattern, string_replacement) 1.string ...
- SQL Server查询中特殊字符的处理方法 (SQL Server特殊符号的转义处理)
SQL Server查询中特殊字符的处理方法 (SQL Server特殊符号的转义处理) SQL Server查询中,经常会遇到一些特殊字符,比如单引号'等,这些字符的处理方法,是SQL Server ...
- SQL Server中批量替换数据
SQL Server数据库中批量替换数据的方法 SQL Server数据库操作中,我们可能会根据某写需要去批量替换数据,那么如何批量修改替换数据呢?本文我们就介绍这一部分内容,接下来就让我们一起来了解 ...
- SQL SERVER将某一列字段中的某个值替换为其他的值 分类: MSSQL 2014-11-05 13:11 67人阅读 评论(0) 收藏
SQL SERVER将某一列字段中的某个值替换为其他的值 UPDATE 表名 SET 列名 = REPLACE(列名 ,'贷','袋') SQL SERVER"函数 replace 的参数 ...
- SQL Server 2005,2008 正则表达式 替换函数应用详解
CREATE function dbo.regexReplace ( @source ntext, --原字符串 ), --正则表达式 ), --替换值 , --是否是全局替换 --是否忽略大小写 ) ...
随机推荐
- Java 查漏补缺
摘自<老马说编程> 计算机程序的思维逻辑 (4) - 整数的二进制表示与位运算 Java中不支持直接写二进制常量,比如,想写二进制形式的11001,Java中不能直接写,可以在前面补0,补 ...
- spring简单介绍
1.spring 的核心技术 IOC(控制翻转)和aop(切面编程) IOC容器是一种设计模式,可以说是工厂模式的升华.它有多种实现方法,其中主要是依赖注入. aop是一种设计思想,通常的功能包括日志 ...
- JSP基础——属性保存范围和request对象
JSP属性保存范围 JSP中提供了四种属性保存范围,分别为page,request,session及application. 1.page范围,指设置的属性只在当前页面有效.通过pageContext ...
- 随机生成UUID(GUID)的方法
- (NSString *)UUID { CFUUIDRef uuid_ref = CFUUIDCreate(NULL); CFStringRef uuid_string_ref= CFUUIDCre ...
- HDFS的工作原理(读和写操作)
工作原理: NameNode和DateNode,NameNode相当于一个管理者,它管理集群内的DataNode,当客户发送请求过来后,NameNode会 根据情况指定存储到哪些DataNode上,而 ...
- web安全之sql注入布尔注入
条件: 当一个页面,存在注入,没显示位,没有数据库出错信息,只能通过页面返回正常不正常进行判断进行sql注入. 了解的函数 exists() 用于检查 子查询是 ...
- android aidl 进程间通信需要注意的地方(android.os.TransactionTooLargeException)
转自:http://blog.sina.com.cn/s/blog_4e1e357d0102wau9.html 1.bus工程实现通过service实现aidl实体类 2.actor工程通过发起bin ...
- ubuntu 14.04安装nginx+php+mysql
前段时间的折腾,颇费一番周折,过程中发现网上的许多资料比较老旧过时了,所以在这里也简单把过程重新整理一遍,争取一帖解决问题. 基于最新的Ubuntu 14.04(2014年9月)搭建nginx.php ...
- 计算bean的和(java)
bean中的属性过多时,要计算一个bean的list之和是一件非常麻烦的事情,可以用java的反射机制解决这件事情,代码如下: package com.jzzhcs.utils; import jav ...
- 如何在JAVA中实现一个固定最大size的hashMap
如何在JAVA中实现一个固定最大size的hashMap 利用LinkedHashMap的removeEldestEntry方法,重载此方法使得这个map可以增长到最大size,之后每插入一条新的记录 ...