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 2: Getting Started with <strong>FILESTREAM</strong>Listing 2-7 demonstrated how to create a <strong>FILESTREAM</strong>-enabled table called Itemsthat uses the default <strong>FILESTREAM</strong> filegroup. If you do not want to use the default<strong>FILESTREAM</strong> filegroup, you use the <strong>FILESTREAM</strong>_ON clause <strong>of</strong> the CREATE TABLEstatement to specify the filegroup, as shown in Listing 2-14.CREATE TABLE [dbo].[Items]([ItemID] UNIQUEIDENTIFIER ROWGUIDCOLNOT NULLUNIQUE ,[ItemNumber] VARCHAR(20) ,[ItemDescription] VARCHAR(50) ,[ItemImage] VARBINARY(MAX) <strong>FILESTREAM</strong>NULL) <strong>FILESTREAM</strong>_ON [NorthPole_fs]Listing 2-14:Creating a table with <strong>FILESTREAM</strong> columns using a specified filegroup.For an example that shows how to change the <strong>FILESTREAM</strong> filegroup associated with anexisting table, see the section Creating a database with multiple <strong>FILESTREAM</strong> filegroups,later in this chapter.<strong>FILESTREAM</strong> filegroup queries<strong>The</strong>re are some system views that you can use to query <strong>FILESTREAM</strong>-related informationon your <strong>SQL</strong> <strong>Server</strong> 2008 database. We will see many <strong>of</strong> them in the coming chapters, buta couple <strong>of</strong> examples are included here.You might need to find out the <strong>FILESTREAM</strong> filegroup that is associated with a specifictable. You can do this by querying the catalog view sys.data_spaces as shown inListing 2-15.69

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

Saved successfully!

Ooh no, something went wrong!