SSIS: Changing target table without remapping all table columns

  • In developing an SSIS package that processes data and writes the output to a table with a 100+ columns, is there a way to change the target table name without having to remap all the columns? 

    For example, in one case the target table name was changed but the columns were left the same.  The SSIS component for the destination 'forgot' all the column mappings and they had to be entered in the GUI again manually.  In another case I was using an identical target table for testing before using the final table.  In each case, the mapping was lost when the table name was changed.  Are there any ways to avoid this?

  • bwelch42 - Tuesday, January 8, 2019 12:44 PM

    In developing an SSIS package that processes data and writes the output to a table with a 100+ columns, is there a way to change the target table name without having to remap all the columns? 

    For example, in one case the target table name was changed but the columns were left the same.  The SSIS component for the destination 'forgot' all the column mappings and they had to be entered in the GUI again manually.  In another case I was using an identical target table for testing before using the final table.  In each case, the mapping was lost when the table name was changed.  Are there any ways to avoid this?

    If you make the source column names match the target column names, you can right-click and select 'Map Items by Matching Names'.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • The package is just an XML file.  In some cases, it's easier to make simple changes in the XML rather than using the GUI.  I believe that this is one of those cases, but it's been a long time, so I'm not absolutely sure.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • If the potential target tables of the package have the exact same structure, and you are using OLE DB connections, then in the "OLE DB Destination" task you can set the Data Access mode to "Table name or view name variable - fast load".  and just assign a user variable the value of the table name you are using.  I wrote a package that can dynamically read from source and destination tables in this way, as long as the various sources have the same structure, and the various destinations have the same structure it works just fine.  You'll probably want to set the DelayValidation property of the Data Flow to True as well.

  • Chris Harshman - Tuesday, January 8, 2019 2:26 PM

    If the potential target tables of the package have the exact same structure, and you are using OLE DB connections, then in the "OLE DB Destination" task you can set the Data Access mode to "Table name or view name variable - fast load".  and just assign a user variable the value of the table name you are using.  I wrote a package that can dynamically read from source and destination tables in this way, as long as the various sources have the same structure, and the various destinations have the same structure it works just fine.  You'll probably want to set the DelayValidation property of the Data Flow to True as well.

    Now that you mention it, I realise that I do this a lot and it works just fine!

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

Viewing 5 posts - 1 through 4 (of 4 total)

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