November 13, 2011 at 7:08 pm
Hi. I have an XML with 3000 records that go to table SalesVolumeHeader and SalesVolumeDetails using the ff Control Flow:
[Foreach Loop Container]
->Insert SalesVolumeHeader Data Flow Task
->Insert SalesVolumeDetails Data Flow Task
->Delete SalesVolume XML
I choose Foreach Loop Container can find Folder Destination and File Extension.
I need to run one loop only for SalesVolumeHeader just to insert ONE SalesVolumeHeaderID require in SalesVolumeDetails ID.
Please Help. Thank You!
November 14, 2011 at 12:51 am
You're using the wrong container. As the name says it, the FOREACH LOOP container will loop for each item.
I would look into the FOR LOOP container. There you can set the number of iterations.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
November 14, 2011 at 12:57 am
I already do that the FOR LOOP Container. problem is i cant set where the folder and file extension is located. when I insert the FOR LOOP Container inside the FOR EACH LOOP Container with a Loop Counter set to 1 still looping for 3000 because of the FOR EACH.
Do you have any solution on how to get a destination inside a FOR LOOP Container? Thank for the reply.
November 14, 2011 at 1:04 am
mikko.carlos (11/14/2011)
I already do that the FOR LOOP Container. problem is i cant set where the folder and file extension is located. when I insert the FOR LOOP Container inside the FOR EACH LOOP Container with a Loop Counter set to 1 still looping for 3000 because of the FOR EACH.Do you have any solution on how to get a destination inside a FOR LOOP Container? Thank for the reply.
You'll have to configure the connection managers with expressions, instead of relying on the FOR EACH loop container to provide you with them. You can use a package configuration to store the folder and extension in an xml config file or a sql server config table.
Another option to solve your issue is to use a script task and use .NET to solve your issue. If you're a bit familiar with C# or VB.NET, it shouldn't be that hard to do.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
November 14, 2011 at 1:26 am
Koen Verbeeck (11/14/2011)
You'll have to configure the connection managers with expressions, instead of relying on the FOR EACH loop container to provide you with them. You can use a package configuration to store the folder and extension in an xml config file or a sql server config table.
Another option to solve your issue is to use a script task and use .NET to solve your issue. If you're a bit familiar with C# or VB.NET, it shouldn't be that hard to do.
Thank you Sir. I will get back to you if something happen. gonna try the script task. though im not familiar how to relate the SSIS to C# or VB.NET.
I'm using Basic SSIS. with Stored Procedure from SQL to Insert, Update, Delete the XML Records. Thank You! 😀
November 14, 2011 at 8:13 am
Why are you trying to load just 1 record?
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
November 14, 2011 at 8:46 am
SQLRNNR (11/14/2011)
Why are you trying to load just 1 record?
I have two columns sir. the salesvolumeheader for id referencing to the saleavolumedetail that came from an xml file with 3000 sales volume records.
sales volume header
id store
1 mall1
2 mall2
sales volume details
id customer product qty
1 cust1 juice 50
1 cust1 milk 37
1 cust2 juice 10
1 cust3 softdrinks 5
2 cust5 milk 1
hope you understand what im trying to say. thank you.
Viewing 7 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply