--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