Advertisement

04.29.2008 at 05:18AM PDT, ID: 23361722
[x]
Attachment Details

SQL Update Query - Replace Text

Asked by splendorx in MS SQL Server

Tags: SQL Server 2000

I am trying to replace a string in a text field, but I am getting an error.

Error:
Argument data type ntext is invalid for argument 1 of replace function.

UPDATE    Pages
SET              PageInfo = REPLACE(PageInfo, 'http://beta.mywebsite.com/lakota/', 'http://www.yahoo.com/')
WHERE     (PageInfo LIKE '%http://beta.mywebsite.com/lakota/%')

Please advise on how to replace a string within a text data type field.  I do not want to replace the whole text field - justa portion of it..

Thank you!Start Free Trial
[+][-]04.29.2008 at 05:30AM PDT, ID: 21461507

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: MS SQL Server
Tags: SQL Server 2000
Sign Up Now!
Solution Provided By: angelIII
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628