Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in SQL by (20.3k points)

I have a table (SQL Server) which references paths (UNC or otherwise), but now the path is going to change.

In the path column, I have many records and I need to change just a portion of the path, but not the entire path. And I need to change the same string to the new one, in every record.

How can I do this with a simple update?

1 Answer

0 votes
by (40.7k points)

Try this code:

updatemyTable

set path = replace(path, 'old_string', 'new_string')

Related questions

0 votes
1 answer
0 votes
1 answer
asked Dec 9, 2020 in SQL by Appu (6.1k points)
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Browse Categories

...