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 10: Integrating <strong>FILESTREAM</strong> with other <strong>SQL</strong> <strong>Server</strong> FeaturesUSE masterGOIF DB_ID('NorthPoleFT') IS NOT NULLDROP DATABASE NorthPoleFTGOCREATE DATABASE NorthPoleFT ON PRIMARY (NAME = NorthPoleFT,FILENAME = 'C:\<strong>Art</strong>OfFS\Demos\Chapter10\NorthPoleFT.mdf'), FILEGROUP NorthPoleFT_fs CONTAINS <strong>FILESTREAM</strong>(NAME = NorthPoleFT_fs,FILENAME = 'C:\<strong>Art</strong>OfFS\Demos\Chapter10\NorthPoleFT_fs') LOG ON (NAME = NorthPoleFT_log,FILENAME = 'C:\<strong>Art</strong>OfFS\Demos\Chapter10\NorthPoleFT_log.ldf')GOListing 10-9:Creating a sample database for full-text indexing.We'll now create a table to store some <strong>of</strong>fice documents, which we'll use for testing thefull-text indexing (Listing 10-10).USE NorthPoleFTGOCREATE TABLE [dbo].[Documents]([DocID] [uniqueidentifier] ROWGUIDCOLNOT NULL ,[DocName] [varchar](128) NULL ,[DocType] [varchar](10) NULL ,[DocBody] [varbinary](MAX) <strong>FILESTREAM</strong>NULL ,CONSTRAINT [PK_Documents] PRIMARY KEY CLUSTERED ( [DocID] ASC ))ON [PRIMARY] <strong>FILESTREAM</strong>_ON [NorthPoleFT_fs]Listing 10-10: Creating a table with <strong>FILESTREAM</strong> columns.372

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

Saved successfully!

Ooh no, something went wrong!