Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There's a really good paper by Microsoft Research called <a href="http://research.microsoft.com/apps/pubs/default.aspx?id=64525" rel="nofollow noreferrer">To Blob or Not To Blob</a>.</p> <p>Their conclusion after a large number of performance tests and analysis is this:</p> <ul> <li><p>if your pictures or document are typically below 256K in size, storing them in a database VARBINARY column is more efficient</p></li> <li><p>if your pictures or document are typically over 1 MB in size, storing them in the filesystem is more efficient (and with SQL Server 2008's FILESTREAM attribute, they're still under transactional control and part of the database)</p></li> <li><p>in between those two, it's a bit of a toss-up depending on your use</p></li> </ul> <p>If you decide to put your pictures into a SQL Server table, I would strongly recommend using a separate table for storing those pictures - do not store the employee foto in the employee table - keep them in a separate table. That way, the Employee table can stay lean and mean and very efficient, assuming you don't always need to select the employee foto, too, as part of your queries.</p> <p>For filegroups, check out <a href="http://msdn.microsoft.com/en-us/library/ms179316.aspx" rel="nofollow noreferrer">Files and Filegroup Architecture</a> for an intro. Basically, you would either create your database with a separate filegroup for large data structures right from the beginning, or add an additional filegroup later. Let's call it "LARGE_DATA".</p> <p>Now, whenever you have a new table to create which needs to store VARCHAR(MAX) or VARBINARY(MAX) columns, you can specify this file group for the large data:</p> <pre><code> CREATE TABLE dbo.YourTable (....... define the fields here ......) ON Data -- the basic "Data" filegroup for the regular data TEXTIMAGE_ON LARGE_DATA -- the filegroup for large chunks of data </code></pre> <p>Check out the MSDN intro on filegroups, and play around with it! </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload