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>So, in this example, the image that was loaded into the <strong>FILESTREAM</strong> column <strong>of</strong> theItems table is stored in the file system folder e943c1e6…5c1f5. Note that the name <strong>of</strong>the folder may be different if you are following this example on your computer, but thehierarchy will be the same.Let's get adventurous and explore this folder. But before that, a statutory warning!In a production system, never touch the <strong>FILESTREAM</strong> files directly!Never update the <strong>FILESTREAM</strong> data directly. I am showing this here only for demonstration purposes,and it should never be done on a production system. If you do, you may corrupt your database. <strong>The</strong><strong>FILESTREAM</strong> data files should be accessed only using the Win32 interface exposed by <strong>SQL</strong> <strong>Server</strong>, asexplained in Chapter 3: Accessing <strong>FILESTREAM</strong> Data from Client Applications.Bearing in mind the risks <strong>of</strong> playing with the <strong>FILESTREAM</strong> data container, let's go aheadand do it anyway, as it will shed some light on how the files are stored in the file system. Ifwe navigate to the file system location for the ItemImage column, we will see somethingvery similar to Figure 2-5.Figure 2-5:<strong>The</strong> contents <strong>of</strong> a <strong>FILESTREAM</strong> data container.76

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

Saved successfully!

Ooh no, something went wrong!