Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase «««34567

SSIS 101: Object Variables, ResultSets, and Foreach Loop Containers Expand / Collapse
Author
Message
Posted Thursday, July 7, 2011 10:06 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, February 6, 2013 4:08 AM
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?!
Post #1138258
Posted Tuesday, August 23, 2011 4:53 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Tuesday, September 6, 2011 10:10 AM
Points: 57, Visits: 46
Thanks Andy for posting such a useful article!!
Post #1164349
Posted Wednesday, February 8, 2012 10:01 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, December 3, 2014 11:31 PM
Points: 3, Visits: 459
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
Post #1249171
Posted Friday, February 24, 2012 4:56 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, November 24, 2014 8:19 AM
Points: 17, Visits: 92
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.


  Post Attachments 
For Each Loop Collection.png (7 views, 31.13 KB)
For Each Loop Variable Mapping.png (7 views, 12.29 KB)
Post #1257321
« Prev Topic | Next Topic »

Add to briefcase «««34567

Permissions Expand / Collapse