17.07.2015 Views

The Art of SQL Server FILESTREAM - Red Gate Software

The Art of SQL Server FILESTREAM - Red Gate Software

The Art of SQL Server FILESTREAM - Red Gate Software

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 11: FileTableThis allows for in-place (or partial) updates to the files, potentially resulting in significantperformance enhancements over other <strong>FILESTREAM</strong> scenarios. This enhancementcomes at the cost <strong>of</strong> transactional integrity. When a file is deleted using non-transactionalaccess, the <strong>FILESTREAM</strong> file will remain and follow the same rules for garbage collectionas other garbage files.FileTable namespace<strong>The</strong> namespace <strong>of</strong> a FileTable refers to its file and folder structure. In order to navigateto a FileTable's root folder, you need to know the machine name, the instance-level<strong>FILESTREAM</strong> share name, the database-level folder name and the FileTable-level foldername. <strong>The</strong> root path can then be constructed like this:\\servername\instance-share\database-directory\FileTable-directory<strong>SQL</strong> <strong>Server</strong> 2012 provides several functions to obtain the correct names <strong>of</strong> the share andfolders. Assuming a default <strong>SQL</strong> <strong>Server</strong> instance with default <strong>FILESTREAM</strong> share name,a database called NorthPole with default <strong>FILESTREAM</strong> directory name, and a FileTablecalled Documents with a default FileTable directory name, the UNC path would be:\\servername\MS<strong>SQL</strong>SERVER\NorthPole\DocumentsIn order to implement an NTFS-compatible structure in <strong>SQL</strong> <strong>Server</strong> tables (referred toas "FileTable semantics" in Books Online), FileTable uses many constraints, computedcolumns and defaults.Constraints and computed columns can cause a lot <strong>of</strong> overhead if many operationsare performed on a FileTable in short order. You might be performing more operationsthan usual if the namespace <strong>of</strong> the FileTable is being reorganized, such as when you aremoving files from one folder to another. Another example might be a bulk load operation.On those occasions, you may consider disabling the constraints to achieve better398

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!