Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Bex
Aged Yak Warrior
580 Posts |
Posted - 2009-02-27 : 10:40:57
|
I have a data flow component where I am using a variable name as the source and the destination (same variable).However, when I try and run the package, I keep getting the error on all columns:The column "InsertedDateTime" needs to be added to the external metadata column collection.The column "EndTransDateTime" needs to be added to the external metadata column collection.The column "RecordDateTime" needs to be added to the external metadata column collection.The column "StoreNo" needs to be added to the external metadata column collection.The column "POSNo" needs to be added to the external metadata column collection.The column "TicketNo" needs to be added to the external metadata column collection.The column "TradingDay" needs to be added to the external metadata column collection.The column "CashierNo" needs to be added to the external metadata column collection.I've deleted and recreated the data source and destination tasks, but to no avail. The structures are identical, so I don't see what the problem is??HeeeelpHearty head pats |
|
tmitch
Yak Posting Veteran
60 Posts |
Posted - 2009-02-27 : 12:38:10
|
What source/destination type are you using?---------------------Tim Mitchellwww.BucketOfBits.com |
 |
|
Bex
Aged Yak Warrior
580 Posts |
Posted - 2009-03-02 : 11:41:15
|
Hi MitchI'm using a variable as the source and destination. This is what the package does:1. Gets the dates from the source database for which a set of tables needs to be created (the results are stored in a object variable)2. Within a Foreach loop, a set of tables is created for each date within the destination database (with the exactly the same structure as those in the source)3. Still within the foreach loop, all the table names to be populated are inserted into an object variable4. Within a foreach loop, each tablename is selected into a string variable and used as the source and destination tables in the source and destination databasesThis works fine if there is only ONE table. However, there are multiple tables to archive, therefore, when the tablename in the variable changes, this creates the validation errors (as the metadata has changed from the previous variable to the new variable value).How can I resolve this? I've turned off validation at each task and at the package level, but I still get the same error.I can have a separate control flow and data flow task for each table, but then this would not be dynamic, so if more tables were added to the database, this would have to be hardcoded into the package as well???!?!???Any ideas?ThanksHearty head pats |
 |
|
tmitch
Yak Posting Veteran
60 Posts |
Posted - 2009-03-02 : 23:37:25
|
If you've got different metadata for each execution of the package, you'll have problems reusing the same data source/destination for varying metadata.Is there any consistency to the metadata you're dealing with? If I read your reply above correctly, you're dealing with more than one set of tables and varying table structures. If you can isolate the different metadata each into its own data flow, you can statically define your metadata in your source/destination within each.If nothing else will work for this scenario, you can always use a script component as a destination, but it does require coding.hth,Tim---------------------Tim Mitchellwww.BucketOfBits.com |
 |
|
Bex
Aged Yak Warrior
580 Posts |
Posted - 2009-03-03 : 09:22:27
|
Thanks Mitch! I did as you mentioned: created a separate dataflow for each table. Not as dynamic as I'd like, but probably more performant (does all the imports in parallel as opposed to one after the other). And it works, so thanks for your assistance! Hearty head pats |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-03-03 : 10:05:36
|
and keep in mind that ssis cant change metadata at run time unless you use a script task to specify mapping |
 |
|
tmitch
Yak Posting Veteran
60 Posts |
Posted - 2009-03-03 : 10:56:13
|
Glad to have helped, and thanks for the follow up.---------------------Tim Mitchellwww.BucketOfBits.com |
 |
|
|
|
|
|
|