SQL Server filetable new features detailed _mssql

Source: Internet
Author: User
Tags filegroup

Filetable is a feature based on FileStream. Some of the following features are available:

• A row represents a file or directory.

• Each row contains the following information:

file_stream stream data, stream_id designator (GUID).

• Path_locator and Parent_path_locator for user representation and maintenance of file and directory-level relationships

• 10 file attributes

• A type column that supports Full-text search and semantic search for files and documents.

filetable enforces certain system-defined constraints and triggers to maintain the semantics of namespaces

• For non-transactional access, SQL Server configures the file and directory structure that is exposed in filetable in the FileStream shared area

Configure the firewall for FILESTREAM access.

--1. Configure instance-level FILESTREAM with the following values--0: Disabling FILESTREAM support for this instance.
--1: Enable FILESTREAM for Transact-SQL access.
--2: Enable FILESTREAM for Transact-SQL and WIN32 stream access. EXEC sp_configure ' filestream_access_level ', 2 Go reconfigure-launches ALTER DATABASE test SET FileStream (non_transacted_acce SS = full, Directory_name = ' test ')--Add FileStream file group ALTER DATABASE Test Add FILEGROUP filestreamgroup CONTAINS Filestrea M go ALTER DATABASE test ADD FILE (NAME = ' fg1 ', FILENAME = ' D:\FileStream\fg1 ') to FILEGROUP filestreamgroup go--Requires non-transactional access , Directory_name SELECT db_name (database_id), non_transacted_access, Non_transacted_access_desc, directory_name from Sys.
Database_filestream_options; Go CREATE TABLE Documentstore as filetable with (filetable_directory = ' documenttable ', filetable_collate_filename = Dat
Abase_default); Go-inserts directory INSERT INTO dbo. 
Documentstore (name, is_directory) SELECT ' MyDir01 ', 1; --In the new directory, insert the file SELECT @path = Path_locator from dbo. Documentstore WHERE name = ' MyDir01 ' SELECT @new_path = @patH. ToString () + CONVERT (VARCHAR), convert (BIGINT, SUBSTRING (CONVERT (BINARY), NEWID (), 1, 6))) + '. ' + Convert (VARCHAR), convert (BIGINT, SUBSTRING (CONVERT (BINARY), NEWID ()), 7, 6)) + '. ' + CONVERT (VARCHAR , convert (BIGINT, SUBSTRING (CONVERT (BINARY, NEWID ()), 4)) + '/' INSERT into dbo. Documentstore (name, File_stream, path_locator) Select N ' empty file. txt ', 0x, @new_path select Getpathlocator (' \\fanr-pc  \sql2016\test\documenttable\1.txt '), * from Documentstore

The above is a small series to introduce the SQL Server filetable new features detailed, I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!

Related Article

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.