dbTalk Databases Forums  

Mutlple text files input to multiple tables

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Mutlple text files input to multiple tables in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
dataguy
 
Posts: n/a

Default Mutlple text files input to multiple tables - 05-06-2005 , 09:29 AM






I have a situation where I have 600 text files that I need to input to
600 tables. Each of the text files relates to one and only one table.
What I would like to be able to do is to setup a generic DTS package
that I could pass the table name and the input text file name to it to
do the import. Does anyone have any suggestions on how to do this?
I'm stumped at how to generically do the transformation part.


Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Mutlple text files input to multiple tables - 05-06-2005 , 03:54 PM






You are going to need to loop over the files
You will then need to set the DataSource property of the Text File source to the file
You will need to set the DestinationObjectName of the DataPump task to the correct table (How will you know the file for the table
mapping?)
You then need to tear down any transformations
Then you need to rebuild the mappings dynamically.

Not a light task at all.

You could of course generate BULK INSERT statements dynamically as well using the infor from the looping over the files and maybe
reading a table to find out what text file goes where.

--

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


"dataguy" <barry_noble (AT) progressive (DOT) com> wrote

Quote:
I have a situation where I have 600 text files that I need to input to
600 tables. Each of the text files relates to one and only one table.
What I would like to be able to do is to setup a generic DTS package
that I could pass the table name and the input text file name to it to
do the import. Does anyone have any suggestions on how to do this?
I'm stumped at how to generically do the transformation part.




Reply With Quote
  #3  
Old   
dataguy
 
Posts: n/a

Default Re: Mutlple text files input to multiple tables - 05-06-2005 , 04:26 PM



I think that will do the trick nicely. It should be easy since the
name of the text file has the same name as the destination table.

Thanks for your hlep.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.