There is a paper archive of documents and diagrams for various studies. On a remote computer is MS SQL 2014 Express.

Objective: to create a database with a description of the archive of documents for further analysis of the contents of the archive. When scanning a document / diagram, save the link to it in the database.

Where to store the scanned file so that it can be accessed from any other computer on the network / internet?

PS: Files are very quite large. 35,000 files, 100 GB in size. I think to keep such volumes in the database is simply not advisable.

  • one
    filestream, for example? - Ella Svetlaya
  • DB does not store files. The “place” for storing data is called blob - field. Different clients (C ++, C #, php) work differently with it. Specifically, in MSSQL there is a blob, xml (for xml files), well, in an extreme case, you can use varchar (8000) with about 7 kb of text. There are other types, but they are derived from blob binary varbinary image msdn.microsoft.com/ru-ru/library/ms187752%28v=sql.120%29.aspx - nick_n_a
  • What would organize access to the "file" you need to write a "gateway" which will record / collect data from the blob field. And the access key - as your imagination allows, from id to the name of the path. - nick_n_a
  • There is a drawback, when storing files in the MSSQL database you have a limit of 4GB (Enterprise) and 10-20 GB. When inside the DBMS the place runs out, the base will stop working. Therefore, in your 2014 EE there is 4GB for 1 base (minus space for service information) - nick_n_a
  • Why do you need a database with a description and structuring of the file archive. i.e. What do you want to use it for? How do files get into the archive ? - Bald

1 answer 1

There is a Filestream mechanism for storing files on the SQL Server side . This mechanism stores BLOBs (files) not in the database itself, but in a separate folder, which prevents the database from growing.

Filestream is supported on SQL Express, but can be turned off by default. Included in the database properties through Management Studio, or directly through SQL.

To access it from the C # side, there is a SqlFileStream class.

The alternative is to simply manually add files to a shared folder on the server + store in the database path to the file.

  • If I use the SqlFileStream files that I save in the database then just don’t pull out? Those. it will not be "1.jpg"? - MaximK
  • This will be a separate file, but with the name-guid-ohm - PashaPash ♦
  • 2
    @MaximK Yes, the files will be as if in a common heap, often without extensions and opening them without a database will be more difficult. Here is an example of the setting - kooboo-cms.ru/articles/detail/ ... However, it may be more convenient (as I sometimes do myself), to write a mini-application for folding files into a specific directory (you can file the file), manually creating a link file write to the database. - Ella Svetlaya