Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7540077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T07:33:02+00:00 2026-05-30T07:33:02+00:00

I have an MS SQL TEXT field. I have the horrific task of cleaning

  • 0

I have an MS SQL TEXT field.

I have the horrific task of cleaning it up.. there is good information and there is intentionally stored HTML in this text field, however I need to find fairly large chunks of it from chunks of a few thousand records at a time and remove it. There will be slight variations that I’ll have to modify.. meaning links and words and html will change.

I use cf and typically handle these with some replace functions.. but these are large blocks.

I also notice on testing that somewhere along the string it just doesn’t find a match when I’m using LIKE '%%'

Sample code that I’m trying to pinpoint is something like this

<div><span style="font-family: Verdana; color: rgb(0, 0, 0); font-size: 12pt;"><span style="color: rgb(0, 0, 0);">View our HUGE selection of </span><a href="http://www.link.com/department-10532.cfm" title="widgets & more!"><span style="color: rgb(0, 0, 0);">Widgets </span></a> <span style="color: rgb(0, 0, 0);">here!</span></span></div><span style="font-family: Verdana; color: rgb(0, 0, 205); font-size: 12pt;">
  <h4> <hr style="color: rgb(128, 0, 0);" />
     </h4>
  <h4 align="center"><span style="font-family: Arial; color: rgb(128, 0, 0); font-size: 8pt;">Shop our site for quality gloves including widgets, more widgets and yet more widgets &amp; so much more!</span></h4>
  <h4 align="center"><span style="font-family: Arial; color: rgb(128, 0, 0); font-size: 8pt;">
      <h4 align="center"><span style="font-family: Verdana; color: rgb(0, 0, 205); font-size: 8pt;"><span style="font-family: Verdana; font-size: 8pt;">Order online or call our Solution Specialist Hotline at 1-800-999-9999</span></span></h4></span></h4><span style="font-family: Verdana; color: rgb(0, 0, 205); font-size: 8pt;"><span style="font-family: Arial; font-size: 8pt;">
      <h4 align="center"> <hr style="color: rgb(128, 0, 0);" />
         </h4><span style="font-family: Verdana; color: rgb(0, 0, 205); font-size: 12pt;"></span></span></span></span></span></div>

Besides the html being horrific, I’m at a complete loss.

doing a command just to find the code like so

where vendorID = 240 and content LIKE '%<SPAN style="FONT-FAMILY:%'

shows results. Yet if I was to build on that line it shows no records at a certain point.

I did try +chr(13)+ in places I thought there was a return. The html is done through one of those web html interfaces, so when it pulls in this text field, it does maintain the breaks and formatting below.

About the only solution I have even thought about being semi successful is to manually spot check the fields that meet this criteria, count the characters and chop off the right of the string. Problem is I have to do this for dozens of variations.

This is a very hard question to be precise and I’ve considered that. The only common denominators are:

  1. this does have certain text phrases that are consistent
  2. It does occur as the last chunk of data in the TEXT field.

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T07:33:03+00:00Added an answer on May 30, 2026 at 7:33 am

    this will help others.
    First – if it is up to you make sure you have data and content separate. it wasn’t up to me. I’m helping after the fact.

    After several attempts – reading other threads I used this

        REReplaceNoCase(Content, "<HR.*?>(.*?)<HR.*?>", "", "all" )
    

    In my case I was trying to find code between two hr tags – and even though they had different styles = this found it.

    I believe I could have just used Replace() as well and rereplace is unneeded.

    Hope this saves someone else a couple hours of surfing.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have text stored in SQL as HTML. I'm not guaranteed that this data
I have a text file stored in my sql DB. in that .txt file
I have a text field who's value is populated from a SQL recordset (below).
I have a text field that inserts its content into an SQL table. Often,
I have a 1) text field type in my Sql server that I would
I have a table in SQL Server 2000 with a text field containing XML
I have inserted xml into SQL Server 2005 through rich text field successfully, now
I have a zipcode stored in a text field (string) and would like to
I'm struggling with correct procedure for executing SQL query. Basically, I have text field
I have a text field and its breaking my sql statement. How do i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.