Solved

Exporting files in a SQL table to a folder easily

Posted on 2013-06-27
1
247 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Via a live example, show how to shrink a transaction log file down to a reasonable size.

729 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