Articles → SQL SERVER → Filetables In The SQL Server
Filetables In The SQL Server
Purpose
- FileStream
- File and folder information
- File attributes
How To Create A Filetable?
CREATE TABLE <File_Table_Name> AS FileTable
WITH (
FileTable_Directory = '<Directory_Name>',
FileTable_Collate_Filename = database_default
);
- Directory name is the root directory of all the files and folders stored in the FileTable
- The directory name must be unique for all filetables for a database
- If the directory name is blank then the name of the filetable is used as the directory name
- The database_default is the name of the collation to be applied on the name column
Restriction On Creating The Filetable
- You cannot alter an existing table to convert it into a FileTable
- You cannot create a FileTable in the tempdb database or in any of the other system databases
- You cannot create a FileTable as a temporary table
How To Change The Directory Of The Filetable?
ALTER TABLE filetable_name
SET ( FILETABLE_DIRECTORY = N'<directory_name>' );