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 9: Investigating <strong>FILESTREAM</strong> Databasessys.partitionsThis view contains a row for each partition <strong>of</strong> all the tables and indexes in the givendatabase. One <strong>of</strong> the columns in this view is filestream_filegroup_id, which pointsto the filegroup ID in the sys.filegroups table.sys.data_spacesThis view returns a row for every filegroup, partition schema, and <strong>FILESTREAM</strong> filegroup.<strong>The</strong> query in Listing 9-2 retrieves all the <strong>FILESTREAM</strong> filegroups in the current database.SELECT*FROM sys.data_spacesWHERE type_desc = '<strong>FILESTREAM</strong>_DATA_FILEGROUP'/*name data_space_id type type_desc is_default------------ ------------- ---- ------------------------- ----------NorthPole_fs 2 FD <strong>FILESTREAM</strong>_DATA_FILEGROUP 1*/Listing 9-2:Retrieving all the <strong>FILESTREAM</strong> filegroups in the current database.<strong>The</strong> following columns <strong>of</strong> this view are related to the <strong>FILESTREAM</strong> feature.• name – <strong>The</strong> name <strong>of</strong> the filegroup, partition schema, or <strong>FILESTREAM</strong> filegroup.• data_space_id – <strong>The</strong> unique data space ID.• type – <strong>The</strong> type <strong>of</strong> data space. For <strong>FILESTREAM</strong> filegroups, this will be set to FD.• type_desc – A description <strong>of</strong> the data space. For <strong>FILESTREAM</strong> filegroups, this willbe <strong>FILESTREAM</strong>_DATA_FILEGROUP.• is_default – If the filegroup is marked as the default filegroup, this will be set to 1.333

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

Saved successfully!

Ooh no, something went wrong!