Рет қаралды 5,602
How and When to Use SQL Server FILESTREAM Datatypes
Filestream
FILESTREAM enables SQL Server-based applications to store unstructured data, such as documents and images, on the file system.
FILESTREAM integrates the SQL Server Database Engine with an NTFS or ReFS file systems by storing varbinary(max) binary large object (BLOB) data as files on the file system.
Transact-SQL statements can insert, update, query, search, and back up FILESTREAM data.
Filestream
FILESTREAM uses the NT system cache for caching file data.
The SQL Server buffer pool is not used; therefore, this memory is available for query processing.
FILESTREAM is not automatically enabled.
You must enable FILESTREAM by using SQL Server Configuration Manager and SQL Server Management Studio.
You must create or modify a database to contain a special type of filegroup.
Then, create or modify a table so that it contains a varbinary(max) column with the FILESTREAM attribute.
When to Use FILESTREAM
Objects that are being stored are, on average, larger than 1 MB.
Fast read access is important.
You are developing applications that use a middle tier for application logic.
FILESTREAM Storage
FILESTREAM storage is implemented as a varbinary(max) column in which the data is stored as BLOBs in the file system.
The sizes of the BLOBs are limited only by the volume size of the file system.
To specify that a column should store data on the file system, specify the FILESTREAM attribute on a varbinary(max) column.
This causes the Database Engine to store all data for that column on the file system, but not in the database file.
FILESTREAM data must be stored in FILESTREAM filegroups.
A FILESTREAM filegroup is a special filegroup that contains file system directories instead of the files themselves.
These file system directories are called data containers.
Data containers are the interface between Database Engine storage and file system storage.
FILESTREAM Storage Considerations
When a table contains a FILESTREAM column, each row must have a nonnull unique row ID.
Multiple data containers can be added to a FILESTREAM filegroup.
FILESTREAM data containers cannot be nested.
When you are using failover clustering, the FILESTREAM filegroups must be on shared disk resources.
FILESTREAM filegroups can be on compressed volumes.
Integrated Management
Most SQL Server management tools and functions work without modification for FILESTREAM data.
For example, you can use all backup and recovery models with FILESTREAM data, and the FILESTREAM data is backed up with the structured data in the database.
Integrated Security
In SQL Server, FILESTREAM data is secured just like other data is secured:
by granting permissions at the table or column levels.
If a user has permission to the FILESTREAM column in a table, the user can open the associated files.
Accessing BLOB Data
After you store data in a FILESTREAM column, you can access the files by using Transact-SQL transactions or by using Win32 APIs.
Transact-SQL Access
By using Transact-SQL, you can insert, update, and delete:
You can use an insert operation to prepopulate a FILESTREAM field with a null value, empty value, or relatively short inline data.
When you update a FILESTREAM field, you modify the underlying BLOB data in the file system. When a FILESTREAM field is set to NULL, the BLOB data associated with the field is deleted.
When you delete a row or delete or truncate a table that contains FILESTREAM data, you delete the underlying BLOB data in the file system.
SQL Server 2019, SQL Server 2019 Filestream, SQL Server When to Use FILESTREAM, SQL Server FILESTREAM Storage, SQL Server 2019 Integrated Management, SQL Server 2019 Integrated Security,
SQL Server Accessing BLOB Data with Transact-SQL and File System Streaming Access, SQL Server Transact-SQL Access, SQL Server File System Streaming Access, SQL Server 2019 Recommendations and guidelines for performance, SQL Server 2019 Removing a FILESTREAM Container
sql server 2019,sql server,filestream,sql server 2019 filestream,filestream issues in sql server,sql server 2019 removing a filestream container,sql server 2012,sql server 2016,sql server 2017,server,sql server filestream storage,instalar sql server 2019,sql server 2008,windows server 2019,sql server when to use filestream,como instalar sql server 2019,filestream in jtl-wawi,database restore in sql server 2017,descargar sql server 2019
To learn latest technology online, visit www.skillpedia.co