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?

Thanks!
RhubarbAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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



eclipse2k
0
eclipse2kCommented:
Mhh ok i guess you need single quotes


Update MyTable
Set MyRecord = Replace(MyRecord, 'example', 'actual')
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
RhubarbAuthor Commented:
It turns out the data was in a Text datatype and that didn't work.

Ended up using code from http://www.sqlteam.com/item.asp?ItemID=15528

I don't know what happens to the points now!
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

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

Ta for the advice.
0
eclipse2kCommented:
thanks for the points Rhubarb!
well i think i would have helped but i didnt knew about the text field.
thanks anyway
0
RhubarbAuthor Commented:
No problem, my own fault for not researching fully before posting - thanks again.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.