0

In my database, I have two tables: Forum and Files

Files have two fields. First one is FileID and second one is FileAddress.

FileId field is fine. but in FileAddress field I have a lot of urls. I want to just change certain parts of url. For example, instead of having http://ipaddress/FILEPATH

I want to chage that to http://domain.com/FILEPATH for about 400 data in the sql table. How do I do this?????

3
Contributors
2
Replies
3
Views
10 Years
Discussion Span
Last Post by MCP
0

In my database, I have two tables: Forum and Files

Files have two fields. First one is FileID and second one is FileAddress.

FileId field is fine. but in FileAddress field I have a lot of urls. I want to just change certain parts of url. For example, instead of having http://ipaddress/FILEPATH

I want to chage that to http://domain.com/FILEPATH for about 400 data in the sql table. How do I do this?????

Hi Desiguru,
You could use the stuff function e.g.
stuff( 'http://ipaddress/FILEPATH', 8, 9, 'domain.com')
this will replace from character 8 the 9 characters 'ipaddress' with 'domain.com'
but you would obviously replace the string to be modified with the field name

stuff( FileAddress, 8, 9, 'domain.com')

and you would obviously need to select the appropriate records

Regards

Rob

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.