0

Is is possible from a stored procedure in SQL Server 2000 to decode a base64 binary string to an image file?

I have to save it to a file system, and that part is solved, I need to get the data in an image file

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
opensas
  • 60,462
  • 79
  • 252
  • 386

1 Answers1

0

It's probably possible somehow (e.g. using COM via the sp_OA% procedures) but it would most likely be awkward: stored procedures are great for manipulating data, but they are not a good tool for accessing the file system or other resources outside MSSQL. In SQL Server 2005 or later you have .NET procedures to make this easier, but I still find it clumsy.

So in this case I would write a small program in your preferred programming language to pull the data from the table and write the files to whatever location you want. That will probably be easier and more reliable than a stored procedure and you can still run it from MSSQL in a scheduled job or whatever.

Pondlife
  • 15,992
  • 6
  • 37
  • 51
  • in fact I solved the file system part with this http://stackoverflow.com/questions/8393564/sql-server-2000-how-to-save-an-image-variable-to-a-file-in-the-file-system-from , the problem I have is how to decode a base64 text to an image field... – opensas Dec 08 '11 at 18:29