SQL Server T-SQL statement to replace/delete sub-strings

Posted by StefanE on Stack Overflow See other posts from Stack Overflow or by StefanE
Published on 2010-06-02T07:50:56Z Indexed on 2010/06/02 9:13 UTC
Read the original article Hit count: 294

Filed under:
|

Hi,

I have a table with 6 columns containing HTML content with some markups in it and now when moving to a new designed site most of this HTML code has to be deleted. More or less all tags except <B> and </B>.

Is there a nice way of doing this, identify all tags end delete them within the data? I'm sure there are no < > symbols in the test so a regular expression would maybe work?

My alternative is to fetch every row, process it and update the database but I'm guessing this is possible to do in T-SQL directly.

My server is an MSSQL 2008 and is located in a hosted environment but I can fetch a local copy if needed.

Thanks, Stefan

© Stack Overflow or respective owner

Related posts about sql-server

Related posts about tsql