Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using WriteText to load a BMP image

Status
Not open for further replies.

rq

Programmer
Jun 13, 2002
56
0
0
US

I have a SQL table that is used to store ID pictures. Field (called FldA) is an image data type that will store these pictures. I want to store bitmap files onto this table wherein each file represent an ID picture. Since I have the file names to these bitmaps and am aware of the folder where these files reside, how do I use WriteText for these files?
 
Writetext is more of how odbc might add textdata to your database..

My question is what is your client library?
Are you doing this with ODBC or ADO or....

If it is with ADO you need to use the command object to read your image via a stream.

Then all you need is a datatype of image toinsert it into.

If it is odbc.. then I think you can use writetext.

However there is a tool that comes with SQL server that can be used to do this.

It is Textcopy.exe

my guess is it is in the binn dir.. But you pass it the name and path of the bmp and it does the rest.

You would need to execute it via xp_cmdshell from inside sqlserver.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top