Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SSIS 101: Object Variables, ResultSets, and Foreach Loop Containers


SSIS 101: Object Variables, ResultSets, and Foreach Loop Containers

Author
Message
daphnezobel
daphnezobel
Forum Newbie
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: General Forum Members
Points: 2 Visits: 7
Hey, this wouldn't work for me if I make the variable assigment (in your example "LastName" type string, it will only run if that variable is of type Object as well....if I do that, then I can't use the variable in anything useful afterwards.

What am I doing wrong here?!
durga palepu
durga palepu
Valued Member
Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)

Group: General Forum Members
Points: 59 Visits: 46
Thanks Andy for posting such a useful article!!
YWS
YWS
Forum Newbie
Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: General Forum Members
Points: 4 Visits: 472
Thanks for the article, Andy. I have a project that needs to read the XML file and load it into JDE tables. In my SSIS package, I loaded the XML file with XML Source and saved the result to a variable, User::XML using Recordset Destination. Then I used a Foreach ADO Enumerator in Foreach Loop Container and mapped the contents of the XML variable into 4 other variables. I am stuck after this since I don't know how to load those variable to JDE table. I was thinking to use Script Task to load into the JDE table but I keep getting error of

System.InvalidCastException: Unable to cast object of type 'System.Data.OleDb.OleDbConnection' to type 'System.Data.SqlClient.SqlConnection'.

Hopefully you can give me some ideas. Thanks in advance.


Yik Wing
agg_rakesh
agg_rakesh
Grasshopper
Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)

Group: General Forum Members
Points: 17 Visits: 95
I have a csv file which has 18 rows and 5 columns. I have transferred the file into a 2 dimensional array.

Now i am using a ForEach from Variable Enumerator.
In the Variable Mappings i have mapped the 5 variables with different indexes.

Refer to the Attachements...

The problem is The loop is running 18 x 5 = 90 times as ForEach loop is not considering it as a 2D array.

Please suggest.
Attachments
For Each Loop Collection.png (7 views, 31.00 KB)
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search