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

How to Dynamically Change Oledb Source and Excel File in Excel Destination. Expand / Collapse
Author
Message
Posted Thursday, October 04, 2012 12:09 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Tuesday, May 14, 2013 4:48 AM
Points: 56, Visits: 136
Hi,
I am Using DataFlow Task in For Loop Container,Now In Control Flow Task I am Converting my Sql Data into Excel File.

That is Oledb Source From Query and Excel Destination.

Now,I want Sql source Query to be dynamically change based on the iteration of For Loop
and also Excel File also change accordingly for the same.

Can any anyone tell how to do this.



Thanks in Advance!
Post #1368166
Posted Thursday, October 04, 2012 2:24 AM


SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Today @ 3:02 AM
Points: 484, Visits: 2,127
avdhut.k (10/4/2012)

Now,I want Sql source Query to be dynamically change based on the iteration of For Loop
and also Excel File also change accordingly for the same.


Sorry but I don't think this is possible in SSIS.


-----------------------------------
http://www.SQL4n00bs.com
Post #1368226
Posted Friday, October 12, 2012 3:24 PM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Yesterday @ 7:59 PM
Points: 1,106, Visits: 2,113
Can you elaborate what will your source SQL statement contain? Are you going to refer to the same columns in each iteration of your loop or the columns will vary?

---
SSIS Tasks Components Scripts Services | http://www.cozyroc.com/

Post #1372373
Posted Friday, October 12, 2012 4:09 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Saturday, May 18, 2013 10:09 PM
Points: 5,658, Visits: 6,100
avdhut.k (10/4/2012)

Now,I want Sql source Query to be dynamically change based on the iteration of For Loop


A mutable source is not available without a third party component, and then you'll have to review what's out there and figure out what works for you and what pitfalls they have. SSIS with standard components does not allow for metadata changes of the source during runtime. You can change the source of the data (IE: same exact structure in two databases/servers) but you can't change the metadata of the data itself.

Excel File also change accordingly for the same.

This you MIGHT be able to do in a Script Component (destination) by including the VBA library for Excel and programmatically dropping in every one of the inbound rows. I sure as heck wouldn't try it though, the complexity is overwhelming.

Out of curiousity, why the loop? Why not just build out the dataflows you need since the metadata is always changing anyway?



- Craig Farrell

Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

For better assistance in answering your questions | Forum Netiquette
For index/tuning help, follow these directions. |Tally Tables

Twitter: @AnyWayDBA
Post #1372378
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse