Andrea Bertolotto
MyMind.InvokeMember("Dump", BindingFlags.Default | BindingFlags.InvokeMethod, null, o, new object[] {"0xD3F3C+00"});
Skip Navigation LinksHome > Articles > T-SQL HTMLDecode function rss  

Skip Navigation Links.
   
HTMLDecode User Defined Function in T-SQL 1.0

2/9/2006
Download  Download (2 KB)

Background

Storing HTML in databases requires, usually, HTML encoding. But using this from high level gives you access even to the HTML Decode function. This is not true if we have to deal with this kind of data directly at T-SQL level.

Usage

Use this as a normal UDF. If some HTML encoded text is passed in, it would be decoded and returned.

For example:
SELECT dbo.HTMLDecode('This text contains "encoded" chars ©')

This is the output:
This text contains "encoded" chars ©


Implementation

This was coded as a quick hack using a lot of string operations to replace hard-coded strings and removing particular patterns containing ASCII char values.
   
My status Get Skype and call me for free.


















 
Copyright © 2004-7 - Andrea Bertolotto - Site Version: 2.3.0.0 - 2/9/2008