Click to See Complete Forum and Search --> : storing binary data via SQL server


Tyler007
July 12th, 2001, 02:17 PM
I'm trying to store bitmaps of pictures in SQL server. I've already tried to do that but I always had to convert back the data to something I could work with. I was wondering if there was a way to do that without having to convert all the information which can be quite long with big pictures, in other words, is there any efficient and fast way to do all that with SQL server ???

Cakkie
July 13th, 2001, 01:17 AM
Well, there is no really good and fast way to do this, but you can choose between two options.

1) You store the pictures in the database, which keeps them all together, but this requires more overhead for the server, and more stuff to code in VB. This should only be done if the data baing stored isn't large.

2) You store the pictures on disk, most likely a shared folder on the database server, and keep a refference (read as path) to the file in the database. This way, you will not load your database server with returning the pictures, because this is done by the OS, and is done quite fast. Also, in VB it takes nothing more than a simple loadpicture to get the picture. The down side of this is that you will need to keep track of permissions on two places, at the database level, and at share level of the directory the pictures are in.

Which one you must take is up to you, but if we are talking big data (like a picture for every product your company sells, which might get up to 10000), you shouldn't use the database to store the pictures, but if we are talking about the pictures of the employees of a company with 50 employees, the database will do just fine.

Tom Cannaerts
slisse@planetinternet.be

Programming today is a race between software engineers striving to build bigger and better idot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook