Click here to Skip to main content
15,884,986 members
Please Sign up or sign in to vote.
3.00/5 (1 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?
Posted
Updated 10-Apr-13 6:17am
v2

How about converting the VARBINARY(Max) as a Base64 string and saving as string in other OLEDB databases?
 
Share this answer
 
Comments
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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900