all groups > sql server programming > september 2007 >
You're in the

sql server programming

group:

Replace in a Text Field



Replace in a Text Field Cindy Mikeworth
9/23/2007 2:15:42 PM
sql server programming: I need to perform a search and replace in a text field. I tried the REPLACE
function, but am receiving the error that the data type text is an invalid
for argument 1 of the replace function.

Can this be accomplished with a transact SQL statement?
Re: Replace in a Text Field Aaron Bertrand [SQL Server MVP]
9/23/2007 3:06:15 PM
If you aren't planning on moving to SQL Server 2005 soon (where you can use
(N)VARCHAR(MAX) types, which don't have the same limitations as (N)TEXT),
see this article I wrote a few years ago:

http://www.aspfaq.com/2445




[quoted text, click to view]
Re: Replace in a Text Field Cindy Mikeworth
9/27/2007 10:44:46 AM
Thanks so much for your response!

Since I'm not really a programmer, the solution was a bit more complicated
than I had hoped. I ended up reassessing the situation, and re-imported my
data using two single quotes where there had been a double-quote.
Re: Replace in a Text Field petery NO[at]SPAM online.microsoft.com (
9/28/2007 8:07:52 AM
Hello Cindy,

Nice to hear you find aother method to do this job.

Best Regards,

Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support

======================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
======================================================



AddThis Social Bookmark Button