Link to home
Start Free TrialLog in
Avatar of tkoty
tkotyFlag for United States of America

asked on

Find and Replace (Update) specific word or phrase in a SQL field

I'm looking to do a find and replace were I need to change/update specific word or phrase in a SQL field.
Example 1:
Field data:  Excellent/1st tier for "Conveys interest & empathy to customer situation" is defined as:

Example 2: In a service environment, an agent would receive an excellent/1st tier rating for Agent effectively transitions without hesitation when the following occurs:

Replace/Update 'excellent' with 'Meets Expectations"

This is the current query I'm using but it looks at the entire field:
UPDATE contentDetail SET question = REPLACE (question, 'Excellent', 'Meets Expectations')
WHERE question LIKE '%Excellent%'

Open in new window

Avatar of chapmandew
chapmandew
Flag of United States of America image

Maybe I am just confused.  Doesn't your query do exactly what you need?
chap is right.  It will work as you have it.
no points please, just agreeing with the other expert.
Avatar of tkoty

ASKER

I thought this would change the entire field to 'Excellent' instead of just replacing the text?
ASKER CERTIFIED SOLUTION
Avatar of chapmandew
chapmandew
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tkoty

ASKER

Thanks for clarifying it before I tried it.