How Insert a Picture Into SQL Server 2000?

Posted on 2003-03-02
Medium Priority
Last Modified: 2007-12-19
How do I insert a Image file into a field, of image type? There is no insert button as in Access ???
Question by:narfk1
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
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 8055515
Access is both a (small) database + a GUI development application.
SQL Server is ONLY a (full-blown) database product, and doesn't have a true user GUI, EM and QA are only Developer & Admin tools.
If you want to insert pictures into a image column, you either need to develop an application that can do this via code, or eventually play around with the TextCopy.exe, which can read a file into a IMAGE or TEXT column.


Expert Comment

ID: 8055555
Hi narfk1,

angel is right. You can't insert images directly into the SQL Server using the Enterprisemanager.

But you still can use ADO to insert the File. Use the AppendChunk and GetChunk methods of a field. Do the following steps

1.) open recordset
2.) open file and copy to membuffer (you can do that from the file directly as well)
3.) call the append chunk methods for the image field until your file is insterted
4.) Update the record

Your file is now inserted in SQL Server

Check out MSDN Documentation for further information. There is also an example inserting images. Look at

LVL 23

Expert Comment

ID: 8058023
It's recommended that you should not store an image directly in SQL Server. Although this can be done (e.g. using IMAGE datatype), it's best to only store the path to the image file in the database. Then, when your front-end application queries the database, it retrieves the file path of the image, and then goes there to open it for display.

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.


Author Comment

ID: 8069865
Angelll I tried using the textcopy.exe program to insert a picture into the database, but it doesn't seem to work. Sorry but Im new to database, but maybe im not inputting the right commands. What would I input when the program asks me to Type the Where clause: ? I only have three column in the Table called PICTURE. 1) ID 2)Person 3)Pict
so would i put the select * FROM PICTURE WHERE ID = '1' or something of that nature??

Expert Comment

ID: 9276202
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Post your closing recommendations!  No comment means you don't care.
LVL 12

Expert Comment

ID: 10994215
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I will leave the following recommendation for this question in the Cleanup topic area:
    PAQ with points refunded

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

EE Cleanup Volunteer

Accepted Solution

Computer101 earned 0 total points
ID: 11135870
PAQed, with points refunded (50)

E-E Admin

Featured Post

Get MySQL database support online, now!

At Percona’s web store you can order your MySQL database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card.

Question has a verified solution.

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

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.
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Viewers will learn how the fundamental information of how to create a table.
Suggested Courses

770 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