Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 WMI Data Reader and Foreach Loop

Author  Topic 

CTDBA
Starting Member

9 Posts

Posted - 2009-02-23 : 16:03:16
I am trying to use a WMI DataReader task to enumerate folders in a certain directory, and then use those folder names in a foreach loop for further processing. For now, I just have a send mail task in there.

For the Data Reader Task, I have the following configurations:
Direct input: Select FileName from Win32)Directory where Name Like 'c:\\temp\\%'
Output Type: Data table
Destination Type: Variable
Destination User:folderList (which is OBJECT)

For the ForEach Loop Edditor, I have the foloowing configured:
Collection: ForeEach Item Enumerator

When I set up the mail task within the foreach loop, I can not select my Object variable in the subject. If I try to cast the Object as a string, I get an error.

Any thoughts on how to pass the results of the WMI data reader to the foreach loop?

TIA
   

- Advertisement -