0

I am using Microsoft SQL server database file (file with .mdf extension) as the database.

I managed to save files into the SQL table as varbinary(max). Now my question is : How do I get back the files?

I am thinking I may still need to use SELECT statement to get the file from the SQL table. However how do I save the file to my hard disk from its current binary format? What are the procedures to do that?

7
  • Retrieve varbinary(MAX) from SQL Server to byte in C# then File.WriteAllBytes() Commented Jan 27, 2015 at 18:18
  • @AlexK. thanks a lot for your useful comment. Do you want to write do your solution for the File.WriteAllBytes() ? I will definitely you give vote up + accept solution if it works. Commented Jan 27, 2015 at 18:22
  • It's pretty much covered in the linked question, you can answer your own question with your solution including the file save and then accept it yourself if you think it'll help others. Commented Jan 27, 2015 at 18:29
  • @AlexK. I probably will do that. Actually I really wanted to thank you by voting up your rep points for giving me a direction so quickly, that's I ask whether you would want to put down your solution. Commented Jan 27, 2015 at 18:33
  • @AlexK. Is there anyway to get back the original file format? E.g. .zip, docx, txt using the method you mentioned? Commented Jan 27, 2015 at 18:40

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.