Sqlserver2008 FileStream solve picture storage problems

Source: Internet
Author: User

The advent of SQL Server FileStream is to resolve a contradiction in the storage of large objects.

How to store pictures

The first is that the method is stored in the database, which is usually done using the image field, or varbinary (max). The advantage is that you can make a unified backup, but in fact the read efficiency is low. Files that are larger than 1MB will be problematic

The second way is that the file is stored in the file system, and a path is stored in the database. In this way the database pressure is reduced, but it is not convenient for unified backup and management.

The file stream of SQL SERVER 2008 is actually the unification of the two. Files are also placed on the file system, but are managed by the database. You can unify backup and restore. FileStream is not a field type, it is defined after a field and declares the column for file flow. The column is still stored in the binary
It is generally in the database to specifically add a filegroup and one or more files to store FILESTREAM data.

Specific operation

1) Enable FileStream (file stream) on the server instance

Open SQL Server Configuration Manager, right-click on the SQL Server service, click Open, right-click on the SQL Server instance where you want to enable FileStream (file stream), select Properties from the right-click menu, Switch to the FileStream (file stream) tab, check the "Enable FileStream (file stream) or full access enabled for Transact-SQL access" option, and you can also access enable FileStream (file stream) for file I/O streams on this tab

2) Enable FileStream (file stream) for the DB instance

Executes the system stored procedure sp_configure and sets the value of the Filestream_access_level parameter to 2

EXEC sp_configure filestream_access_level, 2
GO

Valid values for the Filestream_access_level parameter include:

0 disables FileStream (file stream) on this instance, which is the default value.

1 Enable FileStream (file stream) for Transact-SQL access

2 Enable FileStream (file stream) for Transact-SQL and WIN32 stream access

After these two steps, the FileStream feature is enabled and then imported, no problem.

Sqlserver2008 FileStream solve picture storage problems

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.