storing image in sql server db

  • hi all i wont ask how to do it...

    the thing that i wanna learn is... if i store 500 kb image in my sql server db how much place does it cost...again 500 kb or less or more...

    is it logical for an album site(thousands of images) to backup images to db?

    thanks a lot

  • Have you looked at the column length in dbo.syscolumns ?

    any way, why not storing the images in a sysfile and storing only pointers ?

     

  • The space required will be a little more than the 500 kb original image. First you have a 16 byte pointer in the row where the image is logically contained. That pointer points to a b-tree structure of 8 kb pages that store the actual image data. Without going into details how that structure looks we can just say that it adds just a little more overhead to the size. But for a 500 kb image it does not really make much of a difference.

    Regarding the questions of storing blob data inside the database or only storing the path to a system file, I usually ask whether or not the blobs are necessary to maintain the integrity of the data. For instance, perhaps it can be recreated. If it is important then I say store it in the database. Otherwise it gets much more difficult to maintain, using distributed transactions involving file system activity and other things. No fun at all.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply