Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8086495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:28:10+00:00 2026-06-05T18:28:10+00:00

I have set of flat files (114 files) each file is named with database

  • 0

I have set of flat files (114 files) each file is named with database table name.
I have database schema, So my database is ready with no records in it.

All that i have to do is, process these flat files and insert those records in respective tables.

I created an SSIS package,
I am trying to set Dynamic table name in Ole DB destination.

I have used variable to set Dynamic table Name.

this is how my package is enter image description here

In script Task, I am setting value for variable

 public void Main()
        {
            // TODO: Add your code here

            string _path = string.Empty;
            if(Dts.Variables["FilePath"] != null)
                _path = Dts.Variables["FilePath"].Value.ToString();
            //MessageBox.Show(_path);
            //Variables vars = default(Variables);
            //Dts.VariableDispenser.LockForWrite("TableName");
            //vars["TableName"].Value = _path.Replace(@"C:\Users\GD\", "").Replace(".txt", "");
            Dts.Variables["TableName"].Value = _path.Replace(@"C:\Users\GD\","").Replace(".txt","");
            MessageBox.Show(_path + Environment.NewLine +"TableName: " + Dts.Variables["TableName"].Value.ToString());
            Dts.TaskResult = (int)ScriptResults.Success;
        }

the messageBox gives me the expected data.
But Ole DB Destination table is not recognizing the table name from second loop.

Variables
enter image description here

Ole DB Destination settings
enter image description here

Error Message:

[OLE DB Destination [55]] Error: Column "ActiveCompositionGenericID" cannot be found at the datasource.

“ActiveCompositionGenericID” this is column in First destination Table and First Source File.

For Second File in the Loop this is not expected in Source File (which is happening), and this should also not be in destination table.

This error message confirms me that, Destination table is still pointing to First table name, and it hasn’t changed.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T18:28:13+00:00Added an answer on June 5, 2026 at 6:28 pm

    If the structure of those files and the destination tables are identical then what you are attempting to do will work. Otherwise, the first file(s) will load but once the metadata changes in the input file, the process will fail.

    The above pattern would work fine back in DTS but is not valid for SSIS.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a for each loop that populates from a set of flat files
I have set up multiple targets in a single xml file. I expect all
I have a set of tables where each table's ID key is auto_incrementing. Now
I have a reasonable size flat file database of text documents mostly saved in
I have to import flat files into SQL Server. So far, I've used SSIS
I'm importing a flat file of invoices into a database using C#. I'm using
I am trying to read 738627 records from a flat file into MySQl. The
I have a VB.Net program that reads in a flat file, and then parses
Essentially I have two different flat files Credit & Account with different record structures.
I have a caching class that has a flat file driver, meaning you can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.