SQL SERVER – Do Not Store Images in Database – Store Location of Images (URL)

Just a day ago I received phone call from my friend in Bangalore. He asked me

What do I think of storing images in database and what kind of datatype he should use?

I have very strong opinion about this issue.

I suggest to store the location of the images in the database using VARCHAR datatype instead of any BLOB or other binary datatype.

Storing the database location reduces the size of database greatly as well updating or replacing the image are much simpler as it is just an file operation instead of massive update/insert/delete in database.

Reference : Pinal Dave (https://blog.sqlauthority.com)

Database, SQL String
Previous Post
SQL SERVER – White Papers: Migration from Oracle Sybase, or Microsoft Access to Microsoft SQL Server
Next Post
SQLAuthority News – Top 10 Tips for Successful Software Outsourcing

Related Posts

56 Comments. Leave new

  • please ,how i can upload pdf file from client to wamp server then store the path of file ??

    Reply
  • please ,how i can upload pdf file from client to wamp server then store the path of file ?? i use c# language by visual studio 2010

    Reply
  • If i store image in database using varchar then what is the use of image datatype……

    thanks in advance

    Reply
    • Try to refrain away from Image datatype, it is obsolete now. If you want to store image or blobs inside SQL Server – try to use VARBINARY(MAX) datatype.

      Reply

Leave a Reply