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 11: FileTable-- Create a new <strong>FILESTREAM</strong> filegroupALTER DATABASE NorthPoleADD FILEGROUP NorthPole_fs2 CONTAINS <strong>FILESTREAM</strong>-- Create a new <strong>FILESTREAM</strong> data containerALTER DATABASE NorthPoleADD FILE (NAME = 'NorthPole_fs2',FILENAME = 'C:\<strong>Art</strong>OfFS\Demos\ChapterX\NorthPole_fs2')TO FILEGROUP NorthPole_fs2USE NorthPoleGO-- Place the FileTable data on a specific <strong>FILESTREAM</strong> filegroupCREATE TABLE Documents AS FILETABLE<strong>FILESTREAM</strong>_ON NorthPole_fs2Listing 11-13:Creating a FileTable that uses a specific <strong>FILESTREAM</strong> filegroup.You will notice the <strong>FILESTREAM</strong>_ON clause is the same clause you would use whenchanging the <strong>FILESTREAM</strong> filegroup on a regular table.Create a FileTable using SSMSIn other chapters, we have highlighted that it's not possible to create <strong>FILESTREAM</strong>columns using SSMS. However, SSMS does <strong>of</strong>fer some support for creating FileTables byproviding a shortcut menu entry and Create FileTable template code.To create a FileTable using SSMS, right-click on the Tables node and select the NewFileTable item. If you already have a FileTable defined in the database, you can alsoright-click on the FileTables node. SSMS will create a new query window and include aCreate FileTable template. Unfortunately, the default template requires a lot <strong>of</strong> work tocustomize, including selecting the correct database to create the FileTable in as well asreplacing placeholder values in more than 20 locations.406

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

Saved successfully!

Ooh no, something went wrong!