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

Column out of sync error with excel data flow Expand / Collapse
Author
Message
Posted Tuesday, July 16, 2013 4:13 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Friday, July 11, 2014 6:30 AM
Points: 18, Visits: 97
I am attempting to set a connection string within an excel manager dynamically based on the latest file in a particular folder. Both the file name and sheet name is dynamic from file to file. I have two script tasks for two variables, one for the full file path for the connection string and the second for the sheet name. I have set "delay validation" to true on both the excel connection manager as well as the data flow task.

When I execute I'm receiving the error: "external columns for Excel Source are out of synchronization with the data source columns".

I cannot view the available columns in the excel data flow component because the sheet and file is determine during execution.

I'm not sure where to go from here. Any assistance would be greatly appreciated.

Thank you!
Post #1474327
Posted Wednesday, July 17, 2013 12:07 AM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Today @ 3:14 AM
Points: 4,977, Visits: 11,669
Are the column names exactly the same in all of the files?

Is there exactly the same number of columns in all of the files?

Are the columns in exactly the same order in all of the files?

If the answer to any of the above is no, you will probably have to rethink your approach.



Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

When you ask a question (and please do ask a question: "My T-SQL does not work" just doesn't cut it), please provide enough information for us to understand its context.
Post #1474380
Posted Wednesday, July 17, 2013 6:15 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Friday, July 11, 2014 6:30 AM
Points: 18, Visits: 97
Yes the columns are the exact same, the only change is the file name and sheet name.

I want to also make sure that I'm configuring the data flow correctly, due to the excel task not having an explicit file associated until run time, should I first manually browse to a file and figure the columns in the excel source and SQL destination tasks? Then update the excel task to an expression? Or is that even relevant?
Post #1474531
Posted Wednesday, July 17, 2013 6:22 AM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Today @ 3:14 AM
Points: 4,977, Visits: 11,669
J0shu@ (7/17/2013)
Yes the columns are the exact same, the only change is the file name and sheet name.

I want to also make sure that I'm configuring the data flow correctly, due to the excel task not having an explicit file associated until run time, should I first manually browse to a file and figure the columns in the excel source and SQL destination tasks? Then update the excel task to an expression? Or is that even relevant?


Yes that's exactly what you should do. Put an Excel file somewhere that your process will never use, and create all of the meta data using that.

If you like, the default (or initial) value of your expression can still point to this file, meaning that you do not need to worry about setting 'DelayValidation' either.



Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

When you ask a question (and please do ask a question: "My T-SQL does not work" just doesn't cut it), please provide enough information for us to understand its context.
Post #1474539
Posted Wednesday, July 17, 2013 9:21 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Friday, July 11, 2014 6:30 AM
Points: 18, Visits: 97
That was the issue. Once I built the metadata with a template file the issue was resolved. I also found that I needed to set the "FirstRowHasColumnName" via expression once I updated the connectionstring as an expression but not a big deal. Thank you so much for the assistance!!!
Post #1474684
Posted Wednesday, July 17, 2013 10:51 AM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Today @ 3:14 AM
Points: 4,977, Visits: 11,669
No problem. Well done on getting it working.


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

When you ask a question (and please do ask a question: "My T-SQL does not work" just doesn't cut it), please provide enough information for us to understand its context.
Post #1474734
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse