20131011 sql2012 file-table_anney

Post on 26-Dec-2014

112 views 0 download

description

 

transcript

SQL2012 – FILE TABLE PART1

By Anney

04/10/2023 2

What(1/2)

• SQL Server provides a special table of files, also referred to as a FileTable, for applications that require file and directory storage in the database, with Windows API compatibility and non-transactional access. A FileTable is a specialized user table with a pre-defined schema that stores FILESTREAM data, as well as file and directory hierarchy information and file attributes.

• A FileTable represents a hierarchy of directories and files. It stores data related to all the nodes in that hierarchy, for both directories and the files they contain. This hierarchy starts from a root directory that you specify when you create the FileTable.

• Every row in a FileTable represents a file or a directory.

04/10/2023 3

What(2/2)• Every row contains the following items.

• A FILESTREAM column for stream data and a file_id (GUID) identifier. (The FILESTREAM column is NULL for a directory.)

• Both path_locator and parent_path_locator columns for representing and maintaining the file and directory hierarchy.

• 10 file attributes such as created date and modified date that are useful with file I/O APIs.

• A type column that supports full-text search and semantic search over files and documents.

• A FileTable enforces certain system-defined constraints and triggers to maintain file namespace semantics.

• When the database is configured for non-transactional access, the file and directory hierarchy represented in the FileTable is exposed under the FILESTREAM share configured for the SQL Server instance. This provides file system access for Windows applications.

04/10/2023 4

HOW

04/10/2023 5

Enable FileStream – install

04/10/2023 6

Enable FileStream - installed

04/10/2023 7

Enable FileStream

04/10/2023 8

Configure fileStream_access_levelEXEC sp_configure filestream_access_level, 2 RECONFIGURE

04/10/2023 9

FileStream Access Level

04/10/2023 10

Add FileStream FileGroup

04/10/2023 11

Add FileStream Files

04/10/2023 12

Add FileStream Files(2)

04/10/2023 13

Set FileStream Non-Transacted Access• Non-Transacted

Acces : Full

04/10/2023 14

Start New FileTable

04/10/2023 16

~ TO BE CONTINU~