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 6: <strong>FILESTREAM</strong> with SSIS and SSRSFor each iteration <strong>of</strong> the loop, we will execute the .NET code that loads the image file intothe <strong>FILESTREAM</strong> column <strong>of</strong> the Items table. <strong>The</strong> code that we execute within the loopneeds to know the ItemID <strong>of</strong> the row currently being processed. This can be achieved bycreating one more user variable, into which the Foreach Loop component can store theItemID value <strong>of</strong> the current row. You can do this from the Variable Mappings tab <strong>of</strong> theForeach Loop Editor (Figure 6-15).Figure 6-15:Configuring the Variable Mappings for the Foreach Loop.From the Variable drop-down list, select to create a new variable andmap it to the result set. This opens the Add Variable dialog box again; change the Nameto itemID, the Value type to Int32, and the Value to 0 (Figure 6-16).245

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

Saved successfully!

Ooh no, something went wrong!