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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 11: FileTableFigure 11-4:Changing the FileTable directory name using SSMS.To help you quickly open a Windows Explorer window showing the contents <strong>of</strong> theFileTable, right-click on the FileTable name and select Explore FileTable Directory. Thismenu option will be grayed out if the database is not set up for non-transactional accessor if the FileTable's namespace is disabled.Adding constraints to the FileTableIt's not possible to create constraints on the FileTable at creation time, but you can addconstraints later, using an ALTER TABLE statement. Note that you cannot remove theconstraints that are created by default.By way <strong>of</strong> example, let's add a constraint to the FileTable that would prevent files frombeing created at the FileTable root folder. A constraint like this might be useful if youhave defined folders in the FileTable and you do not want users to create files unlessthey're in one <strong>of</strong> those subfolders. Listing 11-15 shows how to define such a constrainton a FileTable.ALTER TABLE DocumentsADD CONSTRAINT CK__Documents__NoFilesInRootCHECK(is_directory = 1 OR path_locator.GetLevel() > 1)Listing 11-15:Creating a constraint on a FileTable.409

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

Saved successfully!

Ooh no, something went wrong!