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 2: Getting Started with <strong>FILESTREAM</strong>When <strong>SQL</strong> <strong>Server</strong> configures a file system folder as the <strong>FILESTREAM</strong> data container,it creates a file named filestream.hdr, and a folder named $FSLOG. Both <strong>of</strong> these filesystem objects are used by <strong>SQL</strong> <strong>Server</strong> internally and it is strongly recommended that youdo not access or modify them outside <strong>SQL</strong> <strong>Server</strong>.<strong>The</strong> filestream.hdr file stores the internal information that <strong>SQL</strong> <strong>Server</strong> uses to managethe BLOB data stored in the <strong>FILESTREAM</strong> data container, and to associate it with therelational data stored in the database tables. <strong>The</strong> $FSLOG folder is used to keep track <strong>of</strong>the changes applied on the BLOB data stored in the <strong>FILESTREAM</strong> data container, similarto a transaction log in a <strong>SQL</strong> <strong>Server</strong> database.It is important to remember that two databases cannot share the same file systemlocation to store their <strong>FILESTREAM</strong> data. It is not permitted even to use a subfolderwithin the <strong>FILESTREAM</strong> data container <strong>of</strong> one database to store the <strong>FILESTREAM</strong> datacontainer <strong>of</strong> another database.For example, assume that you have a <strong>FILESTREAM</strong>-enabled database named NorthPolewith a <strong>FILESTREAM</strong> data container located in C:\FS\NorthPole. Table 2-1 showssome examples <strong>of</strong> valid and invalid <strong>FILESTREAM</strong> data container locations for another<strong>FILESTREAM</strong>-enabled database called Southpole, assuming the NorthPole databasealready exists.<strong>FILESTREAM</strong> Data ContainerC:\FS\SouthPoleC:\FS\NorthPoleC:\FS\NorthPole\SouthPoleCommentsValidInvalid: C:\FS\NorthPole is already used by theSouthPole database.Invalid: C:\FS\NorthPole is already used by theNorthPole database; therefore the data containercannot be created as a subfolder.Table 2-1:Valid and invalid <strong>FILESTREAM</strong> data container locations.49

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

Saved successfully!

Ooh no, something went wrong!