Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 How do I do URL decoding in SQL?

Author  Topic 

NickStan
Starting Member

36 Posts

Posted - 2007-09-05 : 11:55:42
Hi All

I am running a DTS package every hour that does an import from our Oracle database in our SQL server (2000) database.

The problem is that one of our fields is URL encoded, like this 574774116%3B150155138873

I need to find a way to decode this field either in Oracle or SQL.
I found some code on the internet for Oracle URL decoding but it did not work.

Does anyone know of a way to do this in SQL?

Thanks

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-09-05 : 11:58:19
SELECT REPLACE(Col1, '%3B', ';')
FROM Table1



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2007-09-05 : 13:45:25
Not tested or verified, but a simple google search found this:

http://www.codeproject.com/sqlrs/SQLURLDecode.asp

which looks pretty good.

UPDATE:

here's another: http://debetta.com/blogs/peter_debetta/archive/2007/03/09/33.aspx



- Jeff
http://weblogs.sqlteam.com/JeffS
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-09-05 : 15:12:04
Jeff, you know I can't resist these

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=88926



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2007-09-05 : 16:00:10
quote:
Originally posted by Peso

Jeff, you know I can't resist these

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=88926




I considering writing one myself! Like you, I can't resist when I see code that I know can be shortened/improved! :)

- Jeff
http://weblogs.sqlteam.com/JeffS
Go to Top of Page
   

- Advertisement -