Variable Table Name Help

  • I have built a For Each Loop that picks up the table names I want to clear out and then potentially copy from one server to another. Each table has a different structure, but the structure is the same between the two servers for the same table. What I wanted to do was loop through each table name, truncate the table, and then if a flag was set in the config table reload that table from the other server. I have just about everything working, but I appear to have run into a snag.

    I am running into trouble when it comes to reloading the tables. The metadata appears to have been set with the default value I loaded into the table name variable, and doesn't get re-evaluated in each loop. This is causing the process to fail with errors relating to metadata not being correct.

    Is there any way to get the metadata to re-evaluate each loop so that it will be able to load the tables? I did turn off ValidateExternalMetadata but that only changed the error from the validation step to the pre-execute step. I did some searching on the web, and the few comments I found noted that this would be a problem but not how to get around it or if it was completely impossible to get around.

    Here is the error I am receiving in case it helps.

    [DTS.Pipeline] Error: component "VSR - Table" (1) failed the pre-execute phase and returned error code 0xC0202005.

    Any help is appreciated.

    -Ben

  • You cannot change the metadata of SSIS at runtime.

    Your only hope with this would be to either create lots of of data flows or build a package on the fly with a script task.

    Cheers,CrispinI can't die, there are too many people who still have to meet me!It's not a bug, SQL just misunderstood me!

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply