Solved

Convert url to base64

Posted on 2011-03-14
2
787 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 83

Accepted Solution

by:
Dave Baldwin earned 500 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

I have a large data set and a SSIS package. How can I load this file in multi threading?
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…
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…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

691 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