Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Using Replace to ..well...replace... Expand / Collapse
Author
Message
Posted Monday, August 12, 2013 7:41 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Monday, August 25, 2014 11:46 AM
Points: 98, Visits: 241
I have a field in a table which has hard coded paths for files. Like "http://www..../downloads/files/dlr-tlk-apr-2001.pdf"

I need to update all references to "downloads' and change it to "forms" so all of the paths would look like:

"http://www......./forms/files/dlr-tlk-apr-2001.pdf"

I assume I need to use Replace. What would be the best way of doing this?

Post #1483314
Posted Monday, August 12, 2013 7:55 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Today @ 5:53 PM
Points: 3,637, Visits: 7,931
Without more information, you could test this.
UPDATE MyTable SET
file_path = REPLACE( file_path, '/Downloads/', '/forms/')




Luis C.
Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

Forum Etiquette: How to post data/code on a forum to get the best help
Post #1483323
Posted Monday, August 12, 2013 8:52 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Monday, August 25, 2014 11:46 AM
Points: 98, Visits: 241
Thanks! That's actually what I was going to try but I thought I'd have to end up using it in conjunction with InString or FindSting or something similar.....

Post #1483360
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse