Strip HTML Tags from a String
SQL Server 2000: Tested **
SQL Server 2005: Tested
SQL Server 2008: Tested
SQL Server 2008R2: Tested
SQL Server 2012: Not Tested
Date: 28 Jun 2011
A function to remove all HTML tags from a string.
This is a fairly basic process that merely looks for '<' '>' pairs. This will therefore strip a not equals sign from an equation or code, but the function is really intended to work on text.
It will also not strip out any ASCII codes or non tag HTML codes such as
It may not be automation-worthy, but it will still save a lot of manual editing work.
** NOTE: For this to work in SQL 2000, just substitute the VARCHAR(MAX) variables with VARCHAR(8000).