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>What is very interesting to know is that <strong>SQL</strong> <strong>Server</strong> only checks for the filename andnot the data or a signature inside the file. So, if you create a file named filestream.hdr and place it in one <strong>of</strong> the folders, <strong>SQL</strong> <strong>Server</strong> thinks that it is a <strong>FILESTREAM</strong> datacontainer and will not allow you to configure any <strong>of</strong> its subfolders as a <strong>FILESTREAM</strong> datacontainer. Filegroups are discussed in more detail later in this chapter, in the Tables and<strong>FILESTREAM</strong> filegroups section.Creating <strong>FILESTREAM</strong>-enabled DatabasesA <strong>FILESTREAM</strong>-enabled database is one that has one or more <strong>FILESTREAM</strong> filegroups.Such a database can be used to create relational tables that contain <strong>FILESTREAM</strong>columns. BLOB data that you insert into a <strong>FILESTREAM</strong> column is stored in the<strong>FILESTREAM</strong> data container within the specified <strong>FILESTREAM</strong> filegroup.You can enable <strong>FILESTREAM</strong> when you create a database, or you can enable it on anexisting database. However, before you do either, you must ensure that the <strong>FILESTREAM</strong>feature is enabled and correctly configured at the <strong>SQL</strong> <strong>Server</strong> instance level. Detailedinformation about how to do this is provided in Appendix A: Configuring <strong>FILESTREAM</strong> ona <strong>SQL</strong> <strong>Server</strong> Instance.Note that the configuration demonstrated in this chapter, when creating a new<strong>FILESTREAM</strong>-enabled database, will get you started, but is rather basic and probably notsuitable for a production deployment. In Chapter 7, we discuss how to adapt filegrouparchitectures for very large <strong>FILESTREAM</strong> databases. In this chapter, we also don'tconsider any aspects <strong>of</strong> the configuration <strong>of</strong> the underlying file system; see Chapter 12 fora discussion <strong>of</strong> this topic.Creating a new <strong>FILESTREAM</strong>-enabled databaseOnce you have ensured that the <strong>SQL</strong> <strong>Server</strong> instance is <strong>FILESTREAM</strong> enabled, you cancreate a new <strong>FILESTREAM</strong>-enabled database. It is possible to do this using either SSMSor T-<strong>SQL</strong>.53

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

Saved successfully!

Ooh no, something went wrong!