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> FeaturesAnd finally, let's insert two rows into this table: a Word document and an Excel file(Listing 10-11). If you are following the example, ensure you create these files, or changethe paths to point to files that exist on your computer.SELECT NEWID() ,'<strong>FILESTREAM</strong> Book - List <strong>of</strong> Chapters' ,'.xls' ,bulkcolumnFROM OPENROWSET(BULK 'c:\temp\<strong>FILESTREAM</strong> Book - List <strong>of</strong> Chapters.xls',SINGLE_BLOB) AS x-- Insert the data to the tableINSERT INTO Documents( [DocID] ,[DocName] ,[DocType] ,[DocBody])SELECT NEWID() ,'Chapter 10 – Integrating <strong>FILESTREAM</strong>' ,'.doc' ,bulkcolumnFROM OPENROWSET(BULK 'c:\temp\Chapter 10 - Integrating <strong>FILESTREAM</strong>.doc',SINGLE_BLOB) AS xListing 10-11: Loading documents into the <strong>FILESTREAM</strong> column <strong>of</strong> a table.It is now time to create a full-text index catalog. This can be done either using the SSMSwizard or using T-<strong>SQL</strong> (Listing 10-12).CREATE FULLTEXT CATALOGDocumentCatalogAS DEFAULT ;Listing 10-12: Creating a full-text catalog.373

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

Saved successfully!

Ooh no, something went wrong!