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> Databases/*TableName PartitionNumber FilestreamFolder--------- --------------- ------------------------------------Items 1 8C2E5B76-40E9-4F14-81D1-809DD2AB377EItems 2 9410B335-DF04-48B1-BC14-6B7DE5022133Items 3 5C3C61C5-978B-4014-A8BA-B35FE79127DA*/Listing 9-11:Retrieving the <strong>FILESTREAM</strong> folders <strong>of</strong> each partition.Identifying the <strong>FILESTREAM</strong> filegroup associated with each<strong>FILESTREAM</strong> tableListing 9-12 retrieves all the <strong>FILESTREAM</strong> tables in the current database and shows the<strong>FILESTREAM</strong> filegroups associated with each table.SELECTt.name AS TableName,f.name AS FilestreamFileGroup,fl.physical_name AS FilestreamFolderFROM sys.tables tINNER JOIN sys.filegroups fON f.data_space_id = t.filestream_data_space_idINNER JOIN sys.database_files flON fl.data_space_id = f.data_space_id/*TableName FilestreamFileGroup FilestreamFolder--------- ------------------- --------------------------------------Items2 NorthPole_fs C:\<strong>Art</strong>OfFS\Demos\Chapter9\NorthPole_fsItems3 NorthPole_fs C:\<strong>Art</strong>OfFS\Demos\Chapter9\NorthPole_fsItems4 NorthPole_fs C:\<strong>Art</strong>OfFS\Demos\Chapter9\NorthPole_fsItems NorthPole_fs C:\<strong>Art</strong>OfFS\Demos\Chapter9\NorthPole_fs*/Listing 9-12:Retrieving all the <strong>FILESTREAM</strong> tables and their <strong>FILESTREAM</strong> filegroups.343

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

Saved successfully!

Ooh no, something went wrong!