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)
 For Each Loop and Processing Through DataFlow

Author  Topic 

SeekingWisdom
Starting Member

24 Posts

Posted - 2008-05-02 : 10:55:43


Greetings!

I am painfully learning SSIS and just when I think I have a better understanding of how things work and go down the path that I should take, I hit a wall. Frankly, discouraging and demoralizing.

I am performing a Select of rows that are then passed on to a ForEachLoop with an ADO Enumerator with a FullResultSet.
Variable mappings for the columns used are:

Variable IndexAccountNumber 0
AccountName 1
AccountAddress 2
CountryCode 3

A ScriptTask in the foreach loop allows me to confirm that I am processing rows.

A DataFlow in the ForEachLoop has in it a DERIVED COLUMN item that allows me to assign the four variable fields above to their respective DERIVED COLUMN.

An attempt to use a Flat File Destination to process the derived columns is being made. As I monitor the execution of the package I notice the following message.

Information: 0x4004300B at Data Flow Task, DTS.Pipeline: "component "Flat File Destination" (382)" wrote 0 rows.

Can anyone PLEASE tell me why is it that I am able to see the data being processed through the script task? And yet not see any rows being written to the Flat file. Why?

Any information you may provide would be immensely appreciated.

Thank you and God Bless.



cat_jesus
Aged Yak Warrior

547 Posts

Posted - 2008-05-02 : 11:43:29
This is the wrong forum for SSIS problems.


quote:

Thank you and God Bless.


I'll think about it.





An infinite universe is the ultimate cartesian product.
Go to Top of Page

Qualis
Posting Yak Master

145 Posts

Posted - 2008-05-02 : 11:45:50
What are you trying to accomplish? In your dataflow inside the foreach, do you have a datasource or just the derived column and the destination? Why are you doing it in this fashion instead of just writing your records to the flat file inside your dataflow that is outside the foreach?
Go to Top of Page

SeekingWisdom
Starting Member

24 Posts

Posted - 2008-05-02 : 12:19:34
Thank you for your replay Qualis, cat Jesus.

I have not been working with SSIS long and I am learning as I go and this is my understanding thus far.

The Select allows me to "read" my table to a full result set. The full result set is comprised of all the rows that met the select criteria. Yes? The ForEach Loop than allows me to process each of the selected rows by the looping process. I did not see how else I could access the data that I need for the Flat File other than through the derived columns specifications and the looping performed within the ForEach Loop.

Please note, I am to further manipulate the selected rows by performing some data clean up and merging of columns before creating a delimited flat file.

If I am in the wrong forum for this item of interest I will gladly flag this issue as satisfied and find the appropriate forum. Nevertheless I am grateful for Qualis in the follow-up and desire to address my problem.




Go to Top of Page

Qualis
Posting Yak Master

145 Posts

Posted - 2008-05-02 : 14:11:14
So, you are selecting data, modifying it, and then sending it to a flat file? You can do all that in the dataflow. You don't need to try to use a foreach for that. Just set up your source, add a derived column transform and create your output columns with whatever manipulation you need and then add a flat file destination. When you specify your file connection, go into the advanced section and remove the columns that you don't want to output.
Go to Top of Page

SeekingWisdom
Starting Member

24 Posts

Posted - 2008-05-02 : 14:25:49
Thank you for your reply once again Qualis.

As you can tell I am going through the forest to get to from point A to point B. This because as I said before I am new to world of SSIS. My learning has been trial and error and digging on the internet for other folks in my shoes and left wondering why things behave they way they do. My world has been that of RPG and COBOL and am now trying to transition to SSIS.

I will pursue your suggestion and go at it optimistically. In the mean time can you suggest other material that would help me understand SSIS more.

Thank You!
Go to Top of Page

Qualis
Posting Yak Master

145 Posts

Posted - 2008-05-02 : 14:35:52
http://technet.microsoft.com/en-us/sqlserver/bb331782.aspx
Go to Top of Page
   

- Advertisement -