472,784 Members | 802 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,784 software developers and data experts.

Export Image Data Types to Local PC from SQL Database

Hello All,
I am stuck on a task that I need to complete. What I have is a SQL 2005
DB running with a Table called Docs. The table structure consists of
the following:

Table Structure for Docs
------------------------------------
DocID int - Primary Key
ClientID int - CustomerID
CreatedByUser nvarchar - UserName
CreatedDate datetime - Date of Document stored in SQL DB
Content image - Bytes of actually document
ContentType nvarchar - (application/msword)
ContentTypeImage nvarchar - Path to Image of Document Type(such as
word.gif")
ContentSize int - Size of Document
FriendlyName nvarchar - Name of Document

What I want to do is create a query to export all documents from the
SQL DB to a local folder on the server or even my local pc. Can this be
done?

Thanks

Jun 29 '06 #1
1 3427
(ma**********@gmail.com) writes:
I am stuck on a task that I need to complete. What I have is a SQL 2005
DB running with a Table called Docs. The table structure consists of
the following:

Table Structure for Docs
------------------------------------
DocID int - Primary Key
ClientID int - CustomerID
CreatedByUser nvarchar - UserName
CreatedDate datetime - Date of Document stored in SQL DB
Content image - Bytes of actually document
ContentType nvarchar - (application/msword)
ContentTypeImage nvarchar - Path to Image of Document Type(such as
word.gif")
ContentSize int - Size of Document
FriendlyName nvarchar - Name of Document

What I want to do is create a query to export all documents from the
SQL DB to a local folder on the server or even my local pc. Can this be
done?


First of all, if you are at the position of changing the table schema,
I recommend that you change the data type of image to varbinary(MAX).
varbinary(MAX) permits as much data as image, but is very much like a
require varbinary, and has none of the many quirks with image.

To answer the question, no, you can't just say SELECT and have
files created in the file system. You would need to write a program
to read the column and write the binary value to disk.

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Jun 29 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: dave | last post by:
Hello there, I am at my wit's end ! I have used the following script succesfully to upload an image to my web space. But what I really want to be able to do is to update an existing record in a...
11
by: Mike MacSween | last post by:
My client has an MS Access database application on her local machine. I have full access to that in terms of changing the design. I've got a simple PHP/MySql application on shared hosting, so no...
3
by: Bennett Haselton | last post by:
I'm working on an ASP.Net project where I want to test code on a local machine using a local database as a back-end, and then export it to the production machine where it uses the hosting...
1
by: Dave Crypto | last post by:
Hi there, SUMMARY: 1) When I use phpadmin to export a large database, the file created on my local PC never containes all the tables and information. It seems to max out at about 10mb. 2)...
6
by: maricel | last post by:
Is there anybody out there who have any idea why EXPORT is relatively slower when putting the output file on a network drive - map drive from onother PC compared to putting it on my local PC drive...
16
by: David Lauberts | last post by:
Hi Wonder if someone has some words of wisdom. I have a access 2002 form that contains 2 graph objects that overlay each other and would like to export them as a JPEG to use in a presentation....
6
by: Chris Cox | last post by:
I'm trying to put together a simple access database that will allow a friend to maintain a simple database of products/pictures/prices, which he can then export to html and upload to a website. ...
35
by: Stan Sainte-Rose | last post by:
Hi, What is the better way to save image into a database ? Just save the path into a field or save the image itself ? I have 20 000 images (~ 10/12 Ko per image ) to save. Stan
0
by: kkshansid | last post by:
i cannot export my sql server database to msaccess database which i usually did successfully 3weeks ago pls help me to find the error so that i can correct it in future error is - Validating...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.