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.

Setting the access levelChapter 1: Storing and Managing Unstructured DataAll the rest <strong>of</strong> the work can be done from within <strong>SQL</strong> <strong>Server</strong> Management Studio (SSMS),so open it up and connect to the instance you just <strong>FILESTREAM</strong> enabled. Since we areenabling <strong>FILESTREAM</strong> access on an instance that did not have <strong>FILESTREAM</strong> enabledas part <strong>of</strong> the <strong>SQL</strong> <strong>Server</strong> installation process, we will also need to set the <strong>FILESTREAM</strong>Access Level, as demonstrated in Listing 1-6.EXEC sp_configure filestream_access_level, 2;GORECONFIGUREGOListing 1-6:Setting the <strong>FILESTREAM</strong> access level for the instance.Here, we've enabled both T-<strong>SQL</strong> and file I/O streaming access for the instance. Alternatively,by setting the filestream_access_level to 1, we could have enabled T-<strong>SQL</strong>access only (a value <strong>of</strong> 0 means disabled).This same process can be performed through the SSMS GUI (see Appendix A).Adding <strong>FILESTREAM</strong> storageNext, we need to add a <strong>FILESTREAM</strong> filegroup and <strong>FILESTREAM</strong> file (data container) tothe NorthPole database, as shown in Listing 1-7.ALTER DATABASE NorthPoleADD FILEGROUP NorthPole_fsCONTAINS <strong>FILESTREAM</strong>;GOALTER DATABASE NorthPoleADD FILE (NAME = NorthPole_fs,41

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

Saved successfully!

Ooh no, something went wrong!