Changing HTML encoding in the DB?

  • Thread starter Thread starter darrel
  • Start date Start date
D

darrel

I'm migrating a table of web site content into our CMS. Our CMS (custom
built) stores all HTML in the DB as encoded html.

This one particular table, however, has the HTML stores as unencoded HTML.
I'd like to make this table consistent with the rest of the site data in all
the other tables.

The only way I can think of to do this is to write an ASPX page that queries
all records, then loops through them all doing an UPDATE statement. Just
wondering if there's a better/faster/easier way?

-Darrel
 
"encoded" is a sort of ambiguous term. It could mean HtmlEncoded, etc. But if
it's already in the database, there's no way around using an update
statement. Whether you choose to do this with a "single use" ASP.NET page,
console app, or whatever, you are going to have to get out the column data,
re-encode it (whatever that means to you) and update the column with the new
data, unless you want to write a SQL Server 2005 CLR - hosted .NET class to
be used as a stored proc to do it.
Peter
 
Back
Top