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 3: Accessing <strong>FILESTREAM</strong> Data from Client Applications;WITH cte AS (SELECTItemNumber,ItemImageFROM Items)SELECTItemNumber,ItemImage.PathName()FROM cte/*-- OutputMsg 5539, Level 16, State 1, Line 1<strong>The</strong> ROWGUIDCOL column associated with the <strong>FILESTREAM</strong> being used is not visible*/Listing 3-32:Using a CTE to show that the ROWGUIDCOL must be visible to the PathName() query.Again, because the CTE does not include the ROWGUIDCOL column, a call to thePathName() on any <strong>of</strong> the columns will generate an error. For the same reason, the queryin Listing 3-33 will also fail.SELECTItemNumber,ItemImage.PathName()FROM (SELECTItemNumber,ItemImageFROM Items) a/*-- OutputMsg 5539, Level 16, State 1, Line 1<strong>The</strong> ROWGUIDCOL column associated with the <strong>FILESTREAM</strong> being used is not visiblewhere method PathName is called.*/Listing 3-33:<strong>The</strong> ROWGUIDCOL must be visible to the PathName() query.<strong>The</strong> SELECT statement does not include the ROWGUIDCOL column, so the PathName()query generates an error.122

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

Saved successfully!

Ooh no, something went wrong!