Rename Output Alias by code
Hello everybody,
acording to the graphic (see it), i need to process the input files and rename them with the format Param_X, where the X is the
order number, for example:
-------------------------------------
Input Columns => Output Alias
Id => Param_0
color => Param_1
country => Param_2
.
.
.
column_N => Param_N
-------------------------------------
Doing this, the Update Column Mapping will set automatically. I have thought to do it inside the
Script Component in the nput0_ProcessInputRow procedure, but i don't know if it is posible. Then, i would like to ask you, is it posible? or, is there any other way to do it?.
I know that is posible rename these columns manually, in small tables there is no problem, but in tables with
400-500 columns is a little crazy.
I hope you can help me.
Thanks.
July 14th, 2011 5:02am
AFAIK per code only with script component.
Otherwise directly in the FlatFile Connection Manager. But then the files have to have the same structure.
Free Windows Admin Tool Kit Click here and download it now
July 14th, 2011 5:19am
Ok, but How? this is what i need, because i don't know how to do it.
Can you show me an example?.
Thanks.
July 14th, 2011 5:34am
Example for what?
In Configuration Manager go to the Advanced Tab and rename the Columns.
In a script component define your input columns as ID, etc and the output columns as Param_1, etc.
In your code direct the Input Coluns to the output columns.
Some links for this:
http://www.mathgv.com/sql2005docs/SSISTransformScriptETL.htm
http://www.bimonkey.com/2009/09/the-script-transformation-part-1-a-simple-transformation/
http://msdn.microsoft.com/en-us/library/ms136114.aspx
Free Windows Admin Tool Kit Click here and download it now
July 14th, 2011 6:37am
Example for what?
In Configuration Manager go to the Advanced Tab and rename the Columns.
In a script component define your input columns as ID, etc and the output columns as Param_1, etc.
In your code direct the Input Coluns to the output columns.
I think the OP is asking for a method to do it automatically. Which isn't possible I think.
There's always a point where you have to map the columns manually, be it in the Configuration Manager, in the script compenent (when you define your output columns) or in the OLE DB command.
@kelel: on the side: the OLE DB Command is a very, very slow way to do an update. It is recommended that you write the data to a staging table and perform a set-based update on the destination table using the staging table.MCTS, MCITP - Please mark posts as answered where appropriate.
July 14th, 2011 6:42am
I think that i forgot an importat detail, the main problem is that i have multiple tables with 400-500 columns, and this is the reason which i need to atomate the process.
Free Windows Admin Tool Kit Click here and download it now
July 14th, 2011 7:15am
I think that i forgot an importat detail, the main problem is that i have multiple tables with 400-500 columns, and this is the reason which i need to atomate the process.
The problem is that SSIS depends entirely on the metadata, and for now there is no other process than doing it manually.
You can try to create an SSIS package programmatically, but that is quite a pain.
I would look into a .NET solution.
edit: or if you don't have to do many transformations, you can use the Import/Export wizard.
edit edit: or just script it out with TSQL using SSMS
MCTS, MCITP - Please mark posts as answered where appropriate.
July 14th, 2011 7:37am


