dbTalk Databases Forums  

Import text file into 2 tables

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


Discuss Import text file into 2 tables in the microsoft.public.sqlserver.dts forum.



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

Default Import text file into 2 tables - 09-17-2003 , 10:22 AM






I want to import a textfile into 2 tables.
The inputfile is a fixedlength text file, which contains
some invoicedata and several columns for comments.

I like to split this in two tables, one with invoicedata
and one with commments. One option is to import this file
several times, but it is quite a large file (over 200.000
records), which needs to be imported on a weekly base.

So I am looking for a way to split this file during
import, but I am not so familiar with VBScripting, so I
hope one of you guys can help me out.

Thanks for your help,

Peter Schipper

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

Default Re: Import text file into 2 tables - 09-18-2003 , 01:59 AM






I would forget doing this through VBScript in one hot. Chances are you wil
be using Lookups which means for each row you will run two statements.

Import into a staging table. Use TSQL from there.

--

----------------------------
Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org



"Peter" <PeterSchipper (AT) Yahoo (DOT) com> wrote

Quote:
I want to import a textfile into 2 tables.
The inputfile is a fixedlength text file, which contains
some invoicedata and several columns for comments.

I like to split this in two tables, one with invoicedata
and one with commments. One option is to import this file
several times, but it is quite a large file (over 200.000
records), which needs to be imported on a weekly base.

So I am looking for a way to split this file during
import, but I am not so familiar with VBScripting, so I
hope one of you guys can help me out.

Thanks for your help,

Peter Schipper



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.