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: FileTable<strong>The</strong> addition <strong>of</strong> the FileTable feature in <strong>SQL</strong> <strong>Server</strong> 2012 heralded the first significantchange to <strong>FILESTREAM</strong> since its introduction in <strong>SQL</strong> <strong>Server</strong> 2008. A FileTable is basicallyjust a "normal" <strong>SQL</strong> <strong>Server</strong> table for storing <strong>FILESTREAM</strong> data, via a VARBINARY(MAX)column called file_stream, but which also stores metadata regarding the underlyingfiles and directories. This allows Windows applications to access <strong>FILESTREAM</strong> dataexactly as if it were stored directly on the file system, and addresses the need to access the<strong>FILESTREAM</strong> data outside <strong>of</strong> the context <strong>of</strong> a <strong>SQL</strong> <strong>Server</strong> transaction. It also supportsfeatures such as full-text and semantic search on <strong>FILESTREAM</strong> data.In this chapter, we'll investigate how a FileTable is different from tables with<strong>FILESTREAM</strong> columns and how to create and access FileTables. We'll also look behindthe covers <strong>of</strong> FileTable to understand better how the <strong>FILESTREAM</strong> feature is used toimplement FileTables.Introduction to FileTableFileTable is solidly based on many concepts found in the <strong>FILESTREAM</strong> feature. Justlike normal <strong>FILESTREAM</strong> tables, FileTables are meant to store BLOB data on an NTFSvolume, while keeping that data integrated with the relational data found in the <strong>SQL</strong><strong>Server</strong> database. FileTable also retains full compatibility with existing <strong>SQL</strong> <strong>Server</strong> tools,services, and query options. However, unlike data stored in a traditional <strong>FILESTREAM</strong>column, client applications do not require modifications in order to access data stored ina FileTable. Contrast this to the requirement <strong>of</strong> using the Win32 or .NET streaming APIsin client applications that use normal <strong>FILESTREAM</strong> tables, and you'll agree that FileTableshave an advantage.387

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

Saved successfully!

Ooh no, something went wrong!