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: FileTableSELECT file_stream.GetFileNamespacePath() 'Default',file_stream.GetFileNamespacePath(1, 2) 'Non-default'FROM DocumentsWHERE name = 'File.txt'/*DefaultNon-default------------------- --------------------------------------------------\Documents\File.txt \\<strong>SQL</strong>.domain.us\MS…ER\NorthPole\Documents\File.txt*/Listing 11-27: Using the GetFileNamespacePath() function.GetPathLocatorThis function returns the HIERARCHYID associated with the specified, existing full path.You would use this function if you have a known FileTable path and need to locate the<strong>SQL</strong> <strong>Server</strong> data row associated with it. Books Online provides a migration scenario froma file server to FileTable as an example at http://brurl.com/fs15.In addition, several undocumented T-<strong>SQL</strong> functions have been added. <strong>The</strong>se functionsare used in the constraints related to FileTables, but it appears they cannot be called fromregular T-<strong>SQL</strong> code.PathName<strong>The</strong> PathName() function has been around since the introduction <strong>of</strong> <strong>FILESTREAM</strong>in <strong>SQL</strong> <strong>Server</strong> 2008. <strong>The</strong> function works on the file_stream column <strong>of</strong> a FileTableand you would use its value if you use transactional access to the FileTable and youwant to use the <strong>FILESTREAM</strong> Win32 API calls. You cannot use the return value <strong>of</strong> thePathName() function to open a FileTable file for non-transactional access.425

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

Saved successfully!

Ooh no, something went wrong!