Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Updating NTEXT column. Is this possible?

Author  Topic 

quantass0
Starting Member

1 Post

Posted - 2007-08-14 : 04:58:07
I'm using Sql Server 2005 and ASP.NET 1.1. Within the table is a ntext field containing varying HTML markup. What we want to do is search all records within the table for the following colors:
#cdf1e0|#f0f7f5|#008000|#189b79|#Ddfaec

which could be written as a css style (ie. color:#cdf1e0, rgb(205,241,224)) or within a font tag (ie. <font color="#cdf1e0">). Then switch all these colors to #Ededdc.

Is this possible with a Sql Server 2005 sql query or must i break it up in chunks using C# code as the go between? I've already tried updating the records via C# (i used String to store the ntext sql result) but the final output was horrible; jumble of text and missing tags.

Thanks

nr
SQLTeam MVY

12543 Posts

Posted - 2007-08-14 : 12:35:12
see
http://www.nigelrivett.net/SQLTsql/ReplaceText2.html

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -