Solved

Exporting files in a SQL table to a folder easily

Posted on 2013-06-27
1
237 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 500 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Group by and order by clause 28 36
Left Join with Tuple returning more rows 10 56
Scheduling Jobs for Execution: 4 15
Sql query 34 20
In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

757 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now