Beruflich Dokumente
Kultur Dokumente
FILESTREAM was introduced in SQL Server 2008 for the storage and management of
unstructured data. The FILESTREAM feature allows storing BLOB data (example: word
documents, image files, music and videos etc) in the NT file system and ensures transactional
consistency between the unstructured data stored in the NT file system and the structured
data stored in the table.
FILESTREAM allows SQL Server to take advantage of the NTFS I/O streaming capabilities and at
the same time, maintain transactional consistency of the data.
When the FILESTREAM attribute of a VARBINARY (MAX) column is set, it becomes a ‘FILESTREAM
enabled’ column. A VARBINARY (MAX) column with FILESTREAM attribute is not restricted to
the 2 GB limit SQL Server imposes on Large Value Types. The size of the file is limited by the
size of the disk volume only.
FILESTREAM feature may be enabled with three different levels of access to the FILESTREAM
data, namely:
1. Enable FILESTREAM for Transact-SQL access
2. Enable FILESTREAM for file I/O streaming access
3. Allow remote clients to have streaming access to FILESTREAM data
Once FILESTREAM feature is enabled, the next step is to configure FILESTREAM Access Level.
This is an additional step that is required only if you configure FILESTREAM after the
installation of SQL Server. Open SQL Server Management Studio and open the properties of the
SQL Server 2008 instance. Select the ‘Advanced’ tab and change the ‘FILESTREAM Access Level’
to ‘Transact-SQL Access enabled’ or ‘Full access enabled’.
EXEC sp_configure filestream_access_level, 2
GO
RECONFIGURE
GO
The last parameter to sp_configure specifies the Access Level, where 0 means ‘Disabled’, 1
means ‘Transact-SQL Access Enabled’ and 2 means ‘Full Access Enabled’
You will see a folder named “$FSLOG” and a file “filestream.hdr” there. The folder “$FSLOG”
is the FILESTREAM equivalent of the Database Transaction Log file. “filestream.hdr” contains
important metadata information used by SQL Server internally. Make sure that you do not
tamper with this file.
• FILESTREAM feature is available with all versions of SQL Server 2008, including SQL
Server Express.
• SQL Server Express database has a 4 GB limitation; however this limitation does not
apply to the FILESTREAM data stored in a SQL Server Express database.
• FILESTREAM Columns can be replicated.
• FILESTREAM enabled databases can be used with LOG Shipping
• FILESTREAM columns can be used in Full Text Indexes
• FILESTREAM works with all recovery models
• FILESTREAM File Groups can be placed on compressed disk volumes
• The maximum size of the file that can be stored into the FILESTREAM data storage is
limited by the size of the disk volume only.
• A FILESTREAM enabled database cannot be used for mirroring. This is one of the key
restrictions that I dislike. Mirroring is a very interesting feature and it cannot be used
with FILESTREAM.
• FILESTREAM data is not available in database snapshots. If you create database
snapshots and run a “SELECT * FROM table” query on a table with FILESTREAM columns,
you will get an error. All queries that you run on a FILESTREAM enabled table of a
database snapshot should exclude FILESTREAM columns.
FILESTREAM Limitations
The FILESTREAM implementation in SQL Server 2008 comes with a few limitations. The
following limitations make complete sense to me and I have no complaints on them.
However the following limitations are little restrictive and I really wish to have them removed
in the future versions of SQL Server.
Take note of the following points if you intend to use FILESTREAM in your application.