Working with image data type / blob

  • Hi,

    I'm working on a personal project with a sql server db and web interface, and I want to handle images as is.

    My first question would be is ok to store image directly in the database ?

    And second, how can I compare 2 images ?

    Thanks in advance

    Patrick

  • Sounds like an interesting project.

    With SQL 2005 you'll probably want to consider using VARBINARY(MAX) instead of the IMAGE data type.

    At least one benefit to storing in the database would be that backups/restores are less complicated. If performance became an issue then storing them in the file system and saving the path in the database might make sense.

    As far as comparing two images that depends on how different they are. If you're looking to find duplicate images then you could create a checksum for each VARBINARY column, for example using the HASHBYTES function, and store that value in a separate column to use for comparison.

  • Thanks a lot for your advice !

    I think I'll store the image in the database, as long as this application remains on personal PC. I don't really have to bother about performance right now.

    Cheers

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

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