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 9: Investigating <strong>FILESTREAM</strong> Databasessys.tables<strong>The</strong> system catalog view sys.tables contains a row per user-defined table in the currentdatabase. <strong>The</strong> column filestream_data_space_id refers to the data space ID <strong>of</strong> a<strong>FILESTREAM</strong> filegroup or a partition scheme that consists <strong>of</strong> <strong>FILESTREAM</strong> filegroups.sys.internal_tables<strong>The</strong> system catalog view sys.internal_tables contains one row for every internaltable in the current database. According to Books Online, internal tables are automaticallygenerated by <strong>SQL</strong> <strong>Server</strong> to support specific features; they are generated when thosefeatures are enabled, and removed when the features are disabled. It looks like this is nottrue for the <strong>FILESTREAM</strong>-specific internal table, <strong>FILESTREAM</strong>_TOMBSTONE. It is als<strong>of</strong>ound in the model database and automatically added to every new database, whether ornot the <strong>FILESTREAM</strong> feature is enabled.This view has a number <strong>of</strong> columns that are relevant to the <strong>FILESTREAM</strong> feature.• internal_type – A TINYINT column that specifies the type <strong>of</strong> the internal tablebeing referenced by the current row. If the current database has a <strong>FILESTREAM</strong>tombstone table, it will show up in this view and the internal_type column will beset to 208. (For more information about the tombstone table, refer back to Chapter 7.)• internal_type_desc – <strong>The</strong> text description <strong>of</strong> the internal_type column. For<strong>FILESTREAM</strong> tombstone tables, the value will be <strong>FILESTREAM</strong>_TOMBSTONE.• name – <strong>The</strong> name <strong>of</strong> the table. <strong>FILESTREAM</strong> tombstone tables are named asfilestream_tombstone_nnnnn, where nnnnn is a number that points to theobject_id <strong>of</strong> the table.• filestream_data_space_id – An integer value that is reserved for future use.332

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

Saved successfully!

Ooh no, something went wrong!