Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am very new to SQL Server 2008 and question may look very basic to gurus.

Following in the problem universe.

  1. I have a huge (600 GB size) SQL Server 2008 table that stores pdf files in a column of type Image
  2. Need is to download all the images from database table to my desktop (not on to the server).
  3. I can't run C#, ASP.NET etc in the environment and has to rely on SQL Server Management Studio for the job (I see a option called power shell but not sure how to use it)

Table looks like following

Table name : Attachments

Columns :

FileID (PK, int, not null)  
Owner (int, null)   
file_name (varchar(50), null)   
file_type (varchar(50), null)   
file_size (int, null)   
file_date (datetime, null)  
file_BIN (image, null)  
share|improve this question

migrated from Jan 30 '13 at 17:11

This question came from our site for professional and enthusiast programmers.

Define huge - how many rows is that?? – marc_s Jan 30 '13 at 17:16
Is SSIS an option? – billinkc Jan 30 '13 at 17:58
Can the server directly access your computer (assuming you set up appropriate security permissions on your machine), or is there a firewall in place to prevent that? – Jon Seigel Jan 30 '13 at 18:10

This answer provides the following Simple Talk article with instruction and information on how to extract this data. Unfortunately, there is no cut and dried method for natively converting this data because of the hurdles in storing this kind of data within a database table.

For more discussion on this practice and the issues surrounding it, I suggest you read this answer.

share|improve this answer
Hi Mike, thanks for your update but I do not want to read from or write to the file stored in the table, but want to strip files to my desktop (prefer if possible) or to the server where SQL server is installed. – user2026061 Jan 30 '13 at 20:05
You're talking about the same thing. You need to read the file from the database system, then write it to the file system. – Mike Fal Jan 30 '13 at 20:18

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.