Solved

Convert url to base64

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

739 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