[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Exporting files in a SQL table to a folder easily

Posted on 2013-06-27
1
Medium Priority
?
252 Views
Last Modified: 2013-07-03
What is the easiest way to export files that include mostly images that are located in a SQL table into a folder on my computer?

I am looking for either a software tool that makes this easy or the SQL script I can use to do this.

I look forward to your assistance.

Thank you.
0
Comment
Question by:rporter45
1 Comment
 
LVL 8

Accepted Solution

by:
virtuadept earned 2000 total points
ID: 39281429
You can use a BCP method, using xp_cmdshell from a stored procedure.

Be sure to read the comments, there are some good advice in there.

http://stackoverflow.com/questions/12204577/exporting-binary-file-data-images-from-sql-via-a-stored-procedure

Another example:

http://stackoverflow.com/questions/1673803/how-to-save-an-image-from-sql-server-to-a-file-using-sql

You can use FILESTREAM enable database, on the same server, then some SQL proc(s) to copy your binary data from existing table into the filestream database.

http://msdn.microsoft.com/en-us/library/cc645585.aspx

You could also write a pretty quick C# or VB .NET application to read the database and write out the binary data to a file.


http://stackoverflow.com/questions/3693011/save-binary-file-from-sql-server
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

By, Vadim Tkachenko. In this article we’ll look at ClickHouse on its one year anniversary.
One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question