Solved

Convert url to base64

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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Suggested Solutions

Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

786 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