We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Replace a string

Medium Priority
327 Views
Last Modified: 2012-05-07
I have to update a table with the replace function. The table test has a column text.
This column has string 'Invalid ISBN {11111,222,333}'. I have to replace the string in { and } braces with the new variable value.
update test
set text = 'Invalid ISBN { ' + @ISBNlist + ' }'
where !ID = @id.
 
Can anyone tell me how to use replace in the above update statement?
 
Thanks,
-B

Open in new window

Comment
Watch Question

AneeshDatabase Consultant
CERTIFIED EXPERT
Top Expert 2009

Commented:
if it is of the same struture you can overwrite the field

update test
set text = 'Invalid ISBN { ' + @ISBNlist + ' }'
where ID = @id
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
Thanks guys. I implemented Aneesh's suggestion but Pssandhu's suggestion worked well too.

-B
AneeshDatabase Consultant
CERTIFIED EXPERT
Top Expert 2009

Commented:
.......and you accepted the other solution
:)
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.