Storing PDF files as binary objects in SQL Server, yes or no?

前端 未结 6 1218
忘掉有多难
忘掉有多难 2021-02-07 03:13

I have to find a design decision for the following task:

I have a SQL Server database and it contains a table of orders. PDF documents will be uploaded by users through

6条回答
  •  佛祖请我去吃肉
    2021-02-07 03:46

    With SQL Server 2008, when you have documents that are mostly 1 MB or more in size, the FILESTREAM feature would be recommended. This is based on a paper published by Microsoft Research called To BLOB or not to BLOB which analyzed the pros and cons of storing blobs in a database in great length - great read!

    For documents of less than 256K on average, storing them in a VARBINARY(MAX) column seems to be the best fit.

    Anything in between is a bit of a toss-up, really.

    You say you'll have PDF documents mostly around 100K or so -> those will store very nicely into a SQL Server table, no problem. One thing you might want to consider is having a separate table for the documents that is linked to the main facts table. That way, the facts table will be faster in usage, and the documents don't get in the way of your other data.

提交回复
热议问题