Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: Database: MS SQL Server
 Update partial string with SQL
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

suona
Junior Member

Taiwan
121 Posts

Posted - 04 July 2002 :  10:38:19  Show Profile  Visit suona's Homepage
Sorry for my poor english first .....

I have a problem. There's a SQL database on my machine, I have an ASP program for downloading MP3s. There's an column for the MP3's URL in some table.

There's a lot of MP3s located in the same machine, and this machine changes is URL now.

How can I cahnge all URLs in SQL database, into new URL ?

I look for the " Update " statement in SQL, but the example shows update the whole field in the column, but I want to update partial of the URL string only.

For example:
There's serveral records in table mp3 , column URL :

http://AAA.AAA.AAA/best/001.mp3
http://AAA.AAA.AAA/best/002.mp3
http://AAA.AAA.AAA/worst/001.mp3
http://AAA.AAA.AAA/worst/001.mp3

I want to change into :

http://XXX.XX.XXX/best/001.mp3
http://XXX.XX.XXX/best/002.mp3
http://XXX.XX.XXX/worst/001.mp3
http://XXX.XX.XXX/worst/001.mp3




How can I do ?

grazman
Junior Member

USA
193 Posts

Posted - 04 July 2002 :  11:48:03  Show Profile  Visit grazman's Homepage
This should do it: http://www.sqlteam.com/item.asp?ItemID=7386 (Using Replace in an Update statement). And of course, test it first.

SQLTeam.com - For SQL Server Developers and Administrators
Snitz Info - SQL Server info on Snitz Forums
Go to Top of Page

suona
Junior Member

Taiwan
121 Posts

Posted - 04 July 2002 :  13:04:50  Show Profile  Visit suona's Homepage
Tha.....a.....a.....nks a lot !!!!!!!!!

I'll try this !

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.38 seconds. Powered By: Snitz Forums 2000 Version 3.4.07