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: FileTableperformance while these tasks are being completed. Disabling the constraints is accomplishedby disabling the FileTable's namespace. You will need to re-enable the namespacebefore the FileTable contents will be available again.Before the FileTable's namespace will be re-enabled (and the contents be available usingWindows APIs), <strong>SQL</strong> <strong>Server</strong> will perform a consistency check on the FileTable. If theconsistency check fails, then the namespace will not be re-enabled and the inconsistencymust be fixed.To disable a FileTable's namespace in SSMS, right-click on the FileTable, open the TableProperties dialog box, and go to the FileTable page. Change the value <strong>of</strong> the FileTablenamespace enabled option to False.<strong>The</strong> code in Listing 11-7 disables and then re-enables the FileTable namespace for theDocuments table. Barring a rogue DML operation that takes place between the disableand enable operations, this simple action will not result in inconsistencies.-- Disable the Documents FileTable namespaceALTER TABLE Documents DISABLE FILETABLE_NAMESPACEGO-- Enable the Documents FileTable namespaceALTER TABLE Documents ENABLE FILETABLE_NAMESPACEListing 11-7:Disabling and enabling a FileTable's namespace using T-<strong>SQL</strong>.Since disabling the FileTable namespace disables constraints, this should not be donewithout thoroughly considering the potential implications <strong>of</strong> data consistency problems.399

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

Saved successfully!

Ooh no, something went wrong!