Link to home
Start Free TrialLog in
Avatar of skarj

asked on

bitmaps and binary files in SQLServer fields


i'm new to SQL Server.
what is the best way (or what is the appropriate datatype) for storing large files such as pictures or othe binary files?

further more, how can they be retrieved programtically? can they be passed as arguments? and where can i read or see some examples for VB and/or C++?

basically what i need is to retrieve a picture from the DB with VB6 and pass it as an argument to a C++ DLL.
Avatar of waynemyers

I've always been of the opinion not to store images in the database.  They are static, and the records are very rarely updated.

I would simply make a table with the name of the file, and place them on the server in a shared directory.

I agree with waynemyers,  I tend to store images in the file system and their location as a string.

If you need to store them in the db.  You can use the IMAGE datatype within SQL.

I don't of examples about passing as parameters but you need to store the image in some sort of binary variable and pass that variable.
Avatar of chigrik

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of skarj



if you could just add some comments about the following i'd be grateful:

1. why use chunks? isn't there a way to read the whole file?

2. what is the c++ ty[s i need to use in order to get a pointer to the binary data in varLogo?