all groups > sql server dts > september 2004 >
You're in the

sql server dts

group:

Dynamic column mapping


Dynamic column mapping Krish
9/17/2004 10:45:57 AM
sql server dts:
I believe there a way to do dynamic transformation mapping.

I have source file as text file (two different text files), delimited pipe.
Iam exporting data from text file to Sqlserver database using DTS.

1st type of text file has - 32 columns

2nd type of text file has - 21 columns

(both has same column name, expect number of columns)

Iam using scripts to map two different text files (different names too..),
but finding hard time in mapping columns dynamically.

Any script help appreciated.

Thanks,

Krish






Re: Dynamic column mapping Allan Mitchell
9/18/2004 10:40:25 AM
[quoted text, click to view]

OK

Dynamic mapping is not as easy as it could/should be.

In your instance the solution is simple.

You have two datapump tasks. One for a 32 column text file and one for the 21
column text file.

At the start of the package you check the file to see which type it is. You
then Enble/Disable the correct instance of the datapump.


--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.konesans.com - Consultancy from the people who know


Re: Dynamic column mapping Jamie Carper - MJW Corp
11/15/2004 11:04:08 AM
I too am attempting to dynamically map the destination columns.

I have a DTS that reads from multiple text files importing them into a SQL
tables. I do not know from one file to the next what the structure is going
to be. However I have included a sort of header file for my DTS to read
before the transformation. From this header file I am able thru the Dynamic
Properties to run a SQL query that builds the receiving table. I then thru
the same process set both the Source and Destination. I am also able to set
the column lengths of the TextFile object prior to Transformation.

However I cannot determine how to affect the mappings. All I want is for the
DTS to use the default mapping it uses when I enter the Transformation
dialog. Nothing more nothing less. I want to do this using either the Dynamic
Properties or some other DTS process.




[quoted text, click to view]
Re: Dynamic column mapping Allan Mitchell
11/15/2004 7:31:40 PM
You have mailed me provately and I have supplied a method for doing this

--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.Konesans.com


[quoted text, click to view]

AddThis Social Bookmark Button