﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2005 / Business Intelligence  / Dynamic Destination Field/Column Mapping / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Mon, 20 May 2013 23:35:29 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Dynamic Destination Field/Column Mapping</title><link>http://www.sqlservercentral.com/Forums/Topic764685-147-1.aspx</link><description>Hi,Could you send me the files and let me try...</description><pubDate>Wed, 12 Oct 2011 05:35:54 GMT</pubDate><dc:creator>kranthi_kk1</dc:creator></item><item><title>RE: Dynamic Destination Field/Column Mapping</title><link>http://www.sqlservercentral.com/Forums/Topic764685-147-1.aspx</link><description>Do you have *any* column names?  ie is Col1 a cloumn name that exists in the data, or more a way t convey to use it's the first column?If you do have column names, then you can use an expression to set the query against the excel spreadsheet, and of course, an expression can be a concatenation of variable values.</description><pubDate>Wed, 05 Aug 2009 08:04:04 GMT</pubDate><dc:creator>stevefromOZ</dc:creator></item><item><title>RE: Dynamic Destination Field/Column Mapping</title><link>http://www.sqlservercentral.com/Forums/Topic764685-147-1.aspx</link><description>Thanks Steve.Can the mapping of the columns (alias) be done dynamically via a script or Transformation?Reason been is that I would be processing lots of different files with different formats.E.g. abc.xls has 5 col going to SQL table (A), abc1.xls has 7 col going to SQL table (A), bbb.xls has 3 col going to SQL table (B) etc.I can get the destination into a variable, can I get the alias column names into a variables?Thanks again.</description><pubDate>Wed, 05 Aug 2009 02:43:34 GMT</pubDate><dc:creator>SSIS Newbie</dc:creator></item><item><title>RE: Dynamic Destination Field/Column Mapping</title><link>http://www.sqlservercentral.com/Forums/Topic764685-147-1.aspx</link><description>Another approach would be to use a for-each loop over the files.  Within this you have a dataflow, and within the dataflow you have an excel connection (source) and sql connection (destination).  Set the Excel connection to be an expression, also use an expression to set the query from the excel.  I'd prob look to alias the column names in that query to the true names in the destination.  Doing this, you should get an automapping of columns to the target, by name.</description><pubDate>Tue, 04 Aug 2009 10:14:08 GMT</pubDate><dc:creator>stevefromOZ</dc:creator></item><item><title>RE: Dynamic Destination Field/Column Mapping</title><link>http://www.sqlservercentral.com/Forums/Topic764685-147-1.aspx</link><description>If you can get those values, then probably the easiest thing to do is to create two calculated columns: one for Total Amount and one for Rate Amount.  Populate whichever calculated column is appropriate and have the other be zero (or nothing).Drew</description><pubDate>Tue, 04 Aug 2009 09:16:01 GMT</pubDate><dc:creator>drew.allen</dc:creator></item><item><title>Dynamic Destination Field/Column Mapping</title><link>http://www.sqlservercentral.com/Forums/Topic764685-147-1.aspx</link><description>Hi,Hope somebody can help or point me in the right direction. I would like to know if it is possible to map destination columns dynamically. Let me explain:I have several files to upload with different formatse.g.abc.xls as 5 columns (version 1 of the import  file) col1,col2,col3,col4,col501/07/2009,Product 1,123.00,12.00,135.0002/07/2009,Product 2,125.00,13.00,138.00 abc1.xls has 7 columns (version 2 of the import file)col1,col2,col3,col4,col5,col6,col701/07/2009,Product 1,123.00,12.00,1.00,2.00,135.0002/07/2009,Product 2,125.00,13.00,1.00,2.00,138.00The destination for both files go to the same table (Table 1) with columns:DateDescriptionAmountTaxTotalAmountRateAmount1RateAmount2I have a table that maps the columns with the 2 versions of these filesFile	OldHeader Index	New Headerabc.xls	col1	1	Dateabc.xls	col2	2	Descriptionabc.xls	col3	3	Amountabc.xls	col4	4	Taxabc.xls	col5	5	TotalAmountabc1.xls	col1	1	Dateabc1.xls	col2	2	Descriptionabc1.xls	col3	3	Amountabc1.xls	col4	4	Taxabc1.xls	col5	5	RateAmount1abc1.xls	col6	6	RateAmount2abc1.xls	col7	7	TotalAmountHow can I map the input columns to the output columnse.g.col5 destination column is TotalAmount (abc.xls)col5 destination column is RateAmount1 (abc1.xls)I know how to get these values, but how do you map them to the destination table?Is this possible or is it possible to map using the Index column?Hope this is clear?ThanksSSIS Newbie</description><pubDate>Tue, 04 Aug 2009 03:52:02 GMT</pubDate><dc:creator>SSIS Newbie</dc:creator></item></channel></rss>