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: FileTableMore on using hierarchiesBooks Online has a tutorial available at http://brurl.com/fs14.Root folderA single <strong>SQL</strong> <strong>Server</strong> instance can host multiple FileTables, across multiple databases, soeach database must be assigned a root folder. This root folder becomes a child folder <strong>of</strong>the <strong>FILESTREAM</strong> share on the <strong>SQL</strong> <strong>Server</strong> host. By default, the name <strong>of</strong> the file share isMS<strong>SQL</strong>SERVER (or the <strong>SQL</strong> <strong>Server</strong> instance name, if you use named instances).<strong>The</strong> root folder must be unique across all databases in the same instance, and can beconfigured from SSMS or using T-<strong>SQL</strong>. Using SSMS, simply right-click on the database'snode in Object Explorer and click Properties and then, in the Database Properties dialogbox, go to the Options page, locate the <strong>FILESTREAM</strong> Directory Name option and typein the folder name.Listing 11-5 shows how to set the root folder using a T-<strong>SQL</strong> script. Note that thefolder name can be different from the database name, but it must be a valid Windowsfolder name.-- Configure the root folderALTER DATABASE NorthPole SET <strong>FILESTREAM</strong> (DIRECTORY_NAME = 'NorthPole')Listing 11-5:Set the FileTable root folder name using T-<strong>SQL</strong>.This method can also be used to change the name <strong>of</strong> the root folder, if previously set. Thischange takes effect immediately, although it requires that all active connections to thedatabase are closed. You cannot reset the <strong>FILESTREAM</strong> directory name to NULL as long asthere are FileTables in the database.395

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

Saved successfully!

Ooh no, something went wrong!