Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest SQL, Fabric and Power BI learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Applies to:
SQL Server
Describes how Transact-SQL data manipulation language (DML) commands work with FileTables.
The following considerations apply to INSERT Operations on FileTables:
All the file attribute columns have NOT NULL constraints. If values are not explicitly set, then appropriate default values are supplied.
System-defined constraints are enforced if the INSERT statement sets the name, path_locator, parent_path_locator, or file attributes.
The application can obtain the path_locator for a file or directory by providing the file system path to the GetPathLocator (Transact-SQL) function.
The following considerations apply to UPDATE operations on FileTables:
Updates to any user-defined data are allowed.
System-defined constraints are enforced if the INSERT statement sets the name, path_locator, parent_path_locator, or file attributes.
Updates can be made to the FILESTREAM data in the file_stream column without affecting any of the other columns, including the timestamps.
The following considerations apply to DELETE operations on FileTables:
Deleting a row also removes the corresponding file or directory from the file system.
Deleting a row fails if the row corresponds to a directory that contains other files or directories.
System-defined constraints ensure that DML actions do not compromise the integrity of the file namespace hierarchy. The constraints that are enforced include the following:
When you set or change the name of the file or directory:
Windows file and directory naming conventions are enforced.
The uniqueness of the name in the parent directory is enforced.
When you set or change the location of a file or directory by setting or changing the path_locator or parent_path_locator:
Uniqueness is enforced.
The consistency of the hierarchical tree of directories and files is enforced, including the consistency of path_locator and parent_path_locator values.
The value of is_directory cannot be set to true when the file_stream column is not null. Data in the file_stream column indicates that the row represents a file and not a directory.
File attribute columns cannot be null. NOT NULL constraints are enforced with default values.
The value of last_access_time cannot be earlier than last_write_time and creation_time.
Load Files into FileTables
Work with Directories and Paths in FileTables
Access FileTables with File Input-Output APIs
FileTable DDL, Functions, Stored Procedures, and Views
Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest SQL, Fabric and Power BI learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register todayTraining
Documentation
Access FileTables with File Input-Output APIs - SQL Server
Find out how to use file I/O APIs with FileTables, and learn which file system operations are compatible with FileTables.
Manage FileTables - SQL Server
Explore common administrative tasks you can use to manage FileTables, and learn about FileTable security, backup, and auditing.
Create, Alter, and Drop FileTables - SQL Server
In SQL Server, the FileTables feature uses a directory structure to store files. Learn how to create a new FileTable or alter or drop an existing FileTable.