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: FileTableFileTableRootPathFileTableRootPath() returns the UNC path <strong>of</strong> the root directory <strong>of</strong> the currentdatabase and, with the use <strong>of</strong> the optional argument, appends the root directory <strong>of</strong> thespecified FileTable. On a default server instance and assuming all default share anddirectory names, a call to FileTableRootPath() in the NorthPole database will yieldthis result:\\SERVERNAME\MS<strong>SQL</strong>SERVER\NorthPoleA call to FileTableRootPath('Documents') will yield this result:\\SERVERNAME\MS<strong>SQL</strong>SERVER\NorthPole\DocumentsGetFileNamespacePathThis intrinsic function returns the UNC path <strong>of</strong> the file or folder referenced by thefile_stream column. This function has two optional arguments.<strong>The</strong> first argument determines if the computer name and share name are also included.If the argument is 0 (default), only the relative path starting with the database-leveldirectory is returned. If the argument is 1, the full UNC path is returned.<strong>The</strong> second argument determines if the computer name is converted. <strong>The</strong> default value<strong>of</strong> 0 converts the computer name to NetBIOS format, a value <strong>of</strong> 1 does not convert thecomputer name, and a value <strong>of</strong> 2 returns the fully qualified domain name <strong>of</strong> the server.(This argument and its values are identical to that found in the PathName() intrinsicfunction.)Listing 11-27 shows the use <strong>of</strong> the GetFileNamespacePath() function with the defaultargument values and with non-default argument values.424

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

Saved successfully!

Ooh no, something went wrong!