SQL Server function to decode HTML.
create function dbo.udf_HtmlDecode
(
@text nvarchar(max)
)
returns nvarchar(max)
as
begin
declare @vcResult nvarchar(max);
declare @vcCrLf nvarchar(4);
declare @siPos smallint;
declare @vcEncoded nvarchar(7);
declare @siChar smallint;
set @vcCrLf = char(13) + char(10);
select @vcResult = @text;
select @siPos = patindex('%&#___;%', @vcResult);
while (@siPos > 0)
begin
select @vcEncoded = substring(@vcResult, @siPos, 6);
select @siChar = cast(substring(@vcEncoded, 3, 3) as smallint);
select @vcResult = replace(@vcResult, @vcEncoded, nchar(@siChar));
select @siPos = patindex('%&#___;%', @vcResult);
end;
select @siPos = patindex('%&#____;%', @vcResult);
while (@siPos > 0)
begin
select @vcEncoded = substring(@vcResult, @siPos, 7);
select @siChar = cast(substring(@vcEncoded, 3, 4) as smallint);
select @vcResult = replace(@vcResult, @vcEncoded, nchar(@siChar));
select @siPos = patindex('%&#____;%', @vcResult);
end;
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '"', nchar(0x0022));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '&', nchar(0x0026));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '<', nchar(0x003c));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '>', nchar(0x003e));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, ' ', nchar(0x00a0));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '¡', nchar(0x00a1));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '¢', nchar(0x00a2));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '£', nchar(0x00a3));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '¤', nchar(0x00a4));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '¥', nchar(0x00a5));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '¦', nchar(0x00a6));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '§', nchar(0x00a7));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '¨', nchar(0x00a8));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '©', nchar(0x00a9));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'ª', nchar(0x00aa));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '«', nchar(0x00ab));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '¬', nchar(0x00ac));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '­', nchar(0x00ad));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '®', nchar(0x00ae));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '¯', nchar(0x00af));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '°', nchar(0x00b0));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '±', nchar(0x00b1));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '²', nchar(0x00b2));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '³', nchar(0x00b3));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '´', nchar(0x00b4));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'µ', nchar(0x00b5));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '¶', nchar(0x00b6));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '·', nchar(0x00b7));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '¸', nchar(0x00b8));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '¹', nchar(0x00b9));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'º', nchar(0x00ba));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '»', nchar(0x00bb));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '¼', nchar(0x00bc));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '½', nchar(0x00bd));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '¾', nchar(0x00be));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '¿', nchar(0x00bf));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'À', nchar(0x00c0));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'Á', nchar(0x00c1));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'Â', nchar(0x00c2));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'Ã', nchar(0x00c3));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'Ä', nchar(0x00c4));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'Å', nchar(0x00c5));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'Æ', nchar(0x00c6));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'Ç', nchar(0x00c7));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'È', nchar(0x00c8));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'É', nchar(0x00c9));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'Ê', nchar(0x00ca));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'Ë', nchar(0x00cb));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'Ì', nchar(0x00cc));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'Í', nchar(0x00cd));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'Î', nchar(0x00ce));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'Ï', nchar(0x00cf));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'Ð', nchar(0x00d0));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'Ñ', nchar(0x00d1));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'Ò', nchar(0x00d2));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'Ó', nchar(0x00d3));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'Ô', nchar(0x00d4));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'Õ', nchar(0x00d5));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'Ö', nchar(0x00d6));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '×', nchar(0x00d7));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'Ø', nchar(0x00d8));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'Ù', nchar(0x00d9));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'Ú', nchar(0x00da));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'Û', nchar(0x00db));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'Ü', nchar(0x00dc));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'Ý', nchar(0x00dd));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'Þ', nchar(0x00de));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'ß', nchar(0x00df));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'à', nchar(0x00e0));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'á', nchar(0x00e1));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'â', nchar(0x00e2));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'ã', nchar(0x00e3));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'ä', nchar(0x00e4));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'å', nchar(0x00e5));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'æ', nchar(0x00e6));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'ç', nchar(0x00e7));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'è', nchar(0x00e8));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'é', nchar(0x00e9));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'ê', nchar(0x00ea));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'ë', nchar(0x00eb));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'ì', nchar(0x00ec));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'í', nchar(0x00ed));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'î', nchar(0x00ee));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'ï', nchar(0x00ef));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'ð', nchar(0x00f0));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'ñ', nchar(0x00f1));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'ò', nchar(0x00f2));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'ó', nchar(0x00f3));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'ô', nchar(0x00f4));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'õ', nchar(0x00f5));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'ö', nchar(0x00f6));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '÷', nchar(0x00f7));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'ø', nchar(0x00f8));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'ù', nchar(0x00f9));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'ú', nchar(0x00fa));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'û', nchar(0x00fb));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'ü', nchar(0x00fc));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'ý', nchar(0x00fd));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'þ', nchar(0x00fe));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'ÿ', nchar(0x00ff));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'Œ', nchar(0x0152));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'œ', nchar(0x0153));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'Š', nchar(0x0160));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'š', nchar(0x0161));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'Ÿ', nchar(0x0178));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'ƒ', nchar(0x0192));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'ˆ', nchar(0x02c6));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '˜', nchar(0x02dc));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'Α', nchar(0x0391));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'Β', nchar(0x0392));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'Γ', nchar(0x0393));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'Δ', nchar(0x0394));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'Ε', nchar(0x0395));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'Ζ', nchar(0x0396));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'Η', nchar(0x0397));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'Θ', nchar(0x0398));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'Ι', nchar(0x0399));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'Κ', nchar(0x039a));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'Λ', nchar(0x039b));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'Μ', nchar(0x039c));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'Ν', nchar(0x039d));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'Ξ', nchar(0x039e));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'Ο', nchar(0x039f));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'Π', nchar(0x03a0));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '& Rho ;', nchar(0x03a1));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'Σ', nchar(0x03a3));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'Τ', nchar(0x03a4));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'Υ', nchar(0x03a5));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'Φ', nchar(0x03a6));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'Χ', nchar(0x03a7));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'Ψ', nchar(0x03a8));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'Ω', nchar(0x03a9));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'α', nchar(0x03b1));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'β', nchar(0x03b2));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'γ', nchar(0x03b3));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'δ', nchar(0x03b4));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'ε', nchar(0x03b5));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'ζ', nchar(0x03b6));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'η', nchar(0x03b7));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'θ', nchar(0x03b8));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'ι', nchar(0x03b9));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'κ', nchar(0x03ba));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'λ', nchar(0x03bb));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'μ', nchar(0x03bc));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'ν', nchar(0x03bd));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'ξ', nchar(0x03be));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'ο', nchar(0x03bf));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'π', nchar(0x03c0));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'ρ', nchar(0x03c1));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'ς', nchar(0x03c2));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'σ', nchar(0x03c3));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'τ', nchar(0x03c4));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'υ', nchar(0x03c5));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'φ', nchar(0x03c6));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'χ', nchar(0x03c7));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'ψ', nchar(0x03c8));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'ω', nchar(0x03c9));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'ϑ', nchar(0x03d1));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'ϒ', nchar(0x03d2));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'ϖ', nchar(0x03d6));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, ' ', nchar(0x2002));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, ' ', nchar(0x2003));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, ' ', nchar(0x2009));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '‌', nchar(0x200c));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '‍', nchar(0x200d));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '‎', nchar(0x200e));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '‏', nchar(0x200f));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '–', nchar(0x2013));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '—', nchar(0x2014));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '‘', nchar(0x2018));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '’', nchar(0x2019));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '‚', nchar(0x201a));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '“', nchar(0x201c));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '”', nchar(0x201d));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '„', nchar(0x201e));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '†', nchar(0x2020));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '‡', nchar(0x2021));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '•', nchar(0x2022));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '…', nchar(0x2026));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '‰', nchar(0x2030));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '′', nchar(0x2032));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '″', nchar(0x2033));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '‹', nchar(0x2039));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '›', nchar(0x203a));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '‾', nchar(0x203e));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '⁄', nchar(0x2044));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '€', nchar(0x20ac));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'ℑ', nchar(0x2111));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '℘', nchar(0x2118));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'ℜ', nchar(0x211c));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '™', nchar(0x2122));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, 'ℵ', nchar(0x2135));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '←', nchar(0x2190));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '↑', nchar(0x2191));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '→', nchar(0x2192));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '↓', nchar(0x2193));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '↔', nchar(0x2194));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '↵', nchar(0x21b5));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '⇐', nchar(0x21d0));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '⇑', nchar(0x21d1));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '⇒', nchar(0x21d2));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '⇓', nchar(0x21d3));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '⇔', nchar(0x21d4));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '∀', nchar(0x2200));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '∂', nchar(0x2202));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '∃', nchar(0x2203));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '∅', nchar(0x2205));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '∇', nchar(0x2207));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '∈', nchar(0x2208));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '∉', nchar(0x2209));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '∋', nchar(0x220b));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '∏', nchar(0x220f));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '∑', nchar(0x2211));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '−', nchar(0x2212));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '∗', nchar(0x2217));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '√', nchar(0x221a));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '∝', nchar(0x221d));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '∞', nchar(0x221e));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '∠', nchar(0x2220));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '∧', nchar(0x2227));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '∨', nchar(0x2228));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '∩', nchar(0x2229));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '∪', nchar(0x222a));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '∫', nchar(0x222b));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '∴', nchar(0x2234));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '∼', nchar(0x223c));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '≅', nchar(0x2245));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '≈', nchar(0x2248));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '≠', nchar(0x2260));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '≡', nchar(0x2261));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '≤', nchar(0x2264));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '≥', nchar(0x2265));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '⊂', nchar(0x2282));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '⊃', nchar(0x2283));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '⊄', nchar(0x2284));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '⊆', nchar(0x2286));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '⊇', nchar(0x2287));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '⊕', nchar(0x2295));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '⊗', nchar(0x2297));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '⊥', nchar(0x22a5));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '⋅', nchar(0x22c5));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '⌈', nchar(0x2308));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '⌉', nchar(0x2309));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '⌊', nchar(0x230a));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '⌋', nchar(0x230b));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '⟨', nchar(0x2329));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '⟩', nchar(0x232a));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '◊', nchar(0x25ca));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '♠', nchar(0x2660));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '♣', nchar(0x2663));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '♥', nchar(0x2665));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '♦', nchar(0x2666));
select @vcResult = replace(@vcResult collate Latin1_General_CS_AS, '<p>', @vcCrLf);
return @vcResult;
end;
go