Hi all I was wondering whether it was possible to remove or delete part of a String in a Field? Lets take for example I have:
- A Table called: Table_1
- A Field called: MyField
- MyField contains the value: Hello I am on the msdn forums
Is it possible to perform an UPDATE Query which deletes part of that sentence? If this was hard coded it would be rather simple but if the phrase was changing which would lead to the sentence also changing is it possible to do this?
Lets say I wanted to remove the part which said msdn forums. Then UPDATE the field again which should leave out the bit msdn forums.
Appreciate the responses, Onam.
Yup I used a CONVERT then your code which worked perfectly! Thanks again!
For reference I have posted the code below so if anyone has trouble with the same thing I experienced it can be used as a guidance:
SET myField = REPLACE(CONVERT(VARCHAR(MAX), myField),
'Test I want to replace',
'This is my replace text')