June 21, 2022 at 2:59 pm
Hi,
Which is the best\elegant way to update a string in nvarchar(MAX) column?
The record contains a string similar to this:
'The dog cat sat on the mat'
I just want to replace the above to this:
'The cat sat on the mat'
Is this is the best way:
UPDATE myTable SET
ColumnB=REPLACE(ColumnB,'dog cat','cat' )
WHERE ColumnC='SentenceOne'
Thank you
June 21, 2022 at 7:47 pm
That works.
Michael L John
If you assassinate a DBA, would you pull a trigger?
To properly post on a forum:
http://www.sqlservercentral.com/articles/61537/
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy