Search and Replace in MS SQL Server 2000?

Hi all,

I think this should be fairly stright forward...I hope...

I have a database with a table that contains lots of records which frequently include the word "example". So:

"This is an example record"

How can I automatically replace every use of "example" with "actual", so that record becomes:

"This is an actual record".

Any thoughts?

Who is Participating?
eclipse2kConnect With a Mentor Commented:
Mhh ok i guess you need single quotes

Update MyTable
Set MyRecord = Replace(MyRecord, 'example', 'actual')
Update MyTable
Set MyRecord = Replace(MyRecord, "example", "actual")
--here optional WHERE ....

RhubarbAuthor Commented:
It turns out the data was in a Text datatype and that didn't work.

Ended up using code from

I don't know what happens to the points now!
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

RhubarbAuthor Commented:
Ah, what the hell - between us we have a full answer for any situation I think.

Ta for the advice.
thanks for the points Rhubarb!
well i think i would have helped but i didnt knew about the text field.
thanks anyway
RhubarbAuthor Commented:
No problem, my own fault for not researching fully before posting - thanks again.
All Courses

From novice to tech pro — start learning today.