I need to pull some BLOB data from a SQL Server 2005 database and generate a SQL script to insert this same data in another database, in another server.
I am only allowed to do this using SQL scripts, I can't use any other utility or write a program in Java or .NET to do it.
The other big restriction I have is that I don't have access to the original database (where the original BLOB data is) when I run the script, to copy the BLOB data to the target database, so the data should already be encoded within the SQL script file.
Summing up: is there a way to encode the BLOB data into text so that I can dump it into a SQL INSERT command within a script text file and run it?
I am able to run special T-SQL statements and stored procedures if needed to.