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: Tuesday, June 10, 2014 9:20 AM
Points: 96, Visits: 235
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: Yesterday @ 3:47 PM
Points: 3,342, Visits: 7,225
Without more information, you could test this.
UPDATE MyTable SET
file_path = REPLACE( file_path, '/Downloads/', '/forms/')




Luis C.
I am a great believer in luck, and I find the harder I work the more I have of it. Stephen Leacock

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: Tuesday, June 10, 2014 9:20 AM
Points: 96, Visits: 235
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