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 6: <strong>FILESTREAM</strong> with SSIS and SSRSCongratulations! We have successfully completed the first SSIS lab. Execute thepackage and verify that it executes without error and the <strong>FILESTREAM</strong> columns areupdated correctly.<strong>The</strong> simplest way to verify that the image files are successfully loaded into the<strong>FILESTREAM</strong> column is to run the query in Listing 6-18 and look at the size <strong>of</strong> the BLOBvalue stored in each row.SELECTItemCode,ImageFileName,DATALENGTH(ItemImage) AS FileSizeFROM Items/*ItemCode ImageFileNameFileSize-------- ---------------------- --------1001 C:\Images\IMG_5383.jpg 53033001 C:\Images\IMG_5384.jpg 53444005 C:\Images\IMG_5385.jpg 74896009 C:\Images\IMG_5386.jpg 6470*/Listing 6-18:Verifying that image files are successfully loaded into the <strong>FILESTREAM</strong> column.You can match the FileSize value returned by the query with the size <strong>of</strong> the disk file toverify that the image files have been successfully loaded into the <strong>FILESTREAM</strong> column.We will also cross-verify this in the next lab, where we will perform the reverse operation.We will export the BLOB values from the <strong>FILESTREAM</strong> column into a series <strong>of</strong> disk files.Debugging the codeIf you want to debug your code, you can set break points within the code and theexecution will stop there. If your script task has a break point, it will show a red circle inthe designer window as shown in Figure 6-21.254

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

Saved successfully!

Ooh no, something went wrong!