views:

117

answers:

3

Hi,

I am new to SSIS and SQL.

I got a file with below format, need to download images to a folder usng SSIS package.

http://content.etilize.com/Large/10077459.jpg

Every day this file change. So I need to delete unwanted images from folder as well.

Any code will be a greate help.

Thanks

A: 

I wouldn't use SSIS for this project from what you've described. I would write a small application (maybe with C# .NET) that went to the particular site with the images and checked them against your stored directory and then only downloaded the image if it did not find it on your side. As Gus stated, I'm not sure where looping or SSIS fits in.

Without more information I doubt you'll get anything more specific but good luck!

ajdams
A: 

Agreed-technically, it is possible to use ssis by using script tasks and possibily some foreach containers to delete the unwanted images. However, I believe this would be overkill. I would recommend some sort of c# windows service or even in this simple example a vb script or maybe even powershell would be better (looping in powershell)

rfonn
+1  A: 

Agree that SSIS mioght be an overkill.

For completeness, if you want to do it in SSIS, an FTP task may suit your requirement if suitable for the location from which yoiu are accessing the images. Otherwise, a file system task may suffice.

As for looping, it depends on the nature of your result set, but a 'foreach Loop Container' control flow item will probably do the job. The following iterators are available:

  • File Enumerator
  • Item Enumerator
  • ADO Enumerator
  • ADO.NET Schema Rowset Enumerator
  • From Variable Enumerator
  • NodeList Enumerator SMO Enumerator

The filename could be set dynamically from the 'expressions' property on the task item should you require.

I guessing a bit though, as I'm a little unclear as to your requirements.

James Wiseman