Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Convert url to base64

Posted on 2011-03-14
2
Medium Priority
?
806 Views
Last Modified: 2012-05-11
In SQL 2008 I have a table that I want to insert a record into that has a column whose data consists of xml type elements. One of the elements I want to add is a url, which contains what SQL considers invalid characters - '&' and so on.  How would I go about converting this url to a base64 string so that I can store it that way in this record.
This is similar to what the data would look like:
<ConnectionString>"http://data.acme.com/data.xml?system=blahblah%20&key=FED4AA86-4960-49DE-83B5-6CBC0B68BC69&type=1&version=1.0"</ConnectionString>
0
Comment
Question by:MEINMEL
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 84

Accepted Solution

by:
Dave Baldwin earned 2000 total points
ID: 35131542
This http://www.motobit.com/help/scptutl/cm435.htm may be what you want.
0
 
LVL 23

Expert Comment

by:wdosanjos
ID: 35131584
Try something like this:

select 'http://data.acme.com/data.xml?system=blahblah%20&key=FED4AA86-4960-49DE-83B5-6CBC0B68BC69&type=1&version=1.0' 
    as 'ConnectionString' 
for xml raw(''), elements

Open in new window


The result is:
<ConnectionString>http://data.acme.com/data.xml?system=blahblah%20&key=FED4AA86-4960-49DE-83B5-6CBC0B68BC69&type=1&version=1.0</ConnectionString>

I hope this helps.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question