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: FileTableoptional arguments, table_name and handle_id. If these arguments are notprovided, or NULL is passed, all non-transactional file handles are closed. If table_nameonly is provided, all non-transactional file handles for that table are closed. Iftable_name is provided, then a handle_id can also be specified to close a specificfile. <strong>The</strong> handle IDs <strong>of</strong> open files can be obtained from the dynamic management viewsys.dm_filestream_non_transacted_handles, discussed previously.Advanced FileTable UsesIn this section, we will demonstrate the use <strong>of</strong> FileTable with two other <strong>SQL</strong> <strong>Server</strong>features that are particularly well suited to be used in conjunction with it: full-text searchand semantic search. Full-text search indexes the contents <strong>of</strong> columns <strong>of</strong> supported types(including VARBINARY(MAX) and <strong>FILESTREAM</strong>) and allows for fast searching <strong>of</strong> thosecontents. It is somewhat like the Windows Search feature. Semantic search is new in <strong>SQL</strong><strong>Server</strong> 2012 and builds upon the full-text indexing feature.Full-text searchFileTable is ideally suited as a document storage repository, so adding a full-text index tothe table may help users locate documents. <strong>The</strong> schema <strong>of</strong> FileTables meets the requirementsfor full-text indexing.• <strong>The</strong> file contents are in a VARBINARY(MAX) <strong>FILESTREAM</strong> column.• <strong>The</strong> file extension is stored in a computed column, file_type. This column is used tomap to the correct IFilter.• <strong>The</strong>re is a unique index on the FileTable that meets the requirements for full-textindexing: the primary key <strong>of</strong> the FileTable.430

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

Saved successfully!

Ooh no, something went wrong!