0

So some (a lot) of my data got manipulated through an HTML parser (HTML was in the database, and got inserted into the main view but then saved through the code view) so I have a lot of HTML code that's now corrupted. Example:

<h1 class="Test">
 Some test HTML
</h1>

Would change into:

    <p>&lt;h1 class=&quot;Test&quot;&gt;Some test HTML&lt;h1&gt;</p>

Does anyone know if there's a way to revert this in SQL? I considered a simple search and replace for the common tokens, but that's not ideal as some of them may be on purpose especially the one for quotes. Any help would be greatly appreciated.

robcarney
  • 13
  • 4
  • 1
    Sql Server doesn't support RegEx out the box. Best you have is the simplified pattern matching functionality. Also, please see https://stackoverflow.com/questions/8928378/using-regex-in-sql-server – Rachel Ambler Jun 07 '17 at 17:49
  • 1
    First, get whatever program it was that mangled your HTML fixed. After that, see https://stackoverflow.com/a/1732454/1324345 – alroc Jun 07 '17 at 17:49
  • 2
    This: http://dbareactions.com/search/html – SqlZim Jun 07 '17 at 17:51

0 Answers0