Click here to Skip to main content
14,108,001 members
Rate this:
Please Sign up or sign in to vote.
See more: , +
Hi All,

In my web application (VS2008), I have to transfer result of a query in MS SQL 2005 from one MS SQL instance to another using a portable memory device (both servers are in different networks). The query results include images stored in varbinary(max) fields and varchar fields.

I looked at saving the query results in XML Files, Excel, and even Access 2007. Typical issue is handling of varbinary data. My research suggest that there is conversion issue between varbinary(max) in SQL 2005 and OLE Object in Access.

What would be the best way here? If any one has worked on this before, can you please share experience/code snippets?
Updated 10-Apr-13 6:17am
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

How about converting the VARBINARY(Max) as a Base64 string and saving as string in other OLEDB databases?
GeoNav 10-Apr-13 20:41pm
As I understand, you are suggesting a loop through the dataset populated by the query to fetch each varbinary value and convert it to Base64 string and save it in the OLEDB database. I also convert this back to the varbinary, when I upload this to SQL Server. Is it possible for you to give an example?
GeoNav 11-Apr-13 10:06am
Well, I just got the SQL way of encoding varbinary(max) to / from base64 string. Thanks for the suggesting this approach..... Intends to get the query result as base64 string instead of varbinary and they save is as xml file through a datatable..........

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Cookies | Terms of Service
Web04 | 2.8.190518.1 | Last Updated 11 Apr 2013
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100