How do I store images in a database?

From SQLServer perspective if you answer you can follow any of the below approaches

  1. use BLOB datatype like varbinary(max) in which case image data would be stored in binary format within the database itself. So based on the size and quality of image db size may increase rapidly which will have effect on backup restore operations etc

  2. using File tables. File tables are special type of tables which points to a folder within server and shows its content as rows within the table. We can configure File tables for non transactional access too in which case we can add images either through SQL code or by directly copying to the folder. The advantage with this method is that image will stored in file system itself and reference would be in the file table. You can also index table to make search operations faster and actual image can be fetched as file from the actual folder or accessed through SQL code in binary format