dbTalk Databases Forums  

Multiple flat file format import into SQL

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


Discuss Multiple flat file format import into SQL in the microsoft.public.sqlserver.dts forum.



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

Default Multiple flat file format import into SQL - 05-03-2004 , 10:14 PM






SQL Server 2000 EE

I am automating the process of looping, importing, and
archiving csv files that arrive daily (thanks to
www.sqldts.com/?246). The flat files (csv format
with "double quote" as text qualifier and no header) are
placed in a shared folder. The import process works fine
as long as the flat files are all csv with double quote
text qualifier and no header.

Unfortunately, the files have a header sometimes (albeit
rarely). The DTS imports the header as a separate row in
the table and wrecks havoc with my subsequent SQL scripts

To add fuel to the fire, they sometimes do not have a
double quote text qualifier.

I'm trying to make the users standardize their flat files
to a fixed format but unfortunately they don't always
listen and play by the rules.

Please pass on ideas to resolve these issues. Also, ideas
on improving this whole process of frequently importing
flat files into SQL are appreciated.

Thanks,
Vinod.


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

Default Re: Multiple flat file format import into SQL - 05-04-2004 , 12:58 AM






For your header problem you could filter this in your script as well from
the article you are using. Simply check for a header and you can then set
the properties of the text file so that you skip n rows. (not tried)



--
--

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


"Vinod" <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
SQL Server 2000 EE

I am automating the process of looping, importing, and
archiving csv files that arrive daily (thanks to
www.sqldts.com/?246). The flat files (csv format
with "double quote" as text qualifier and no header) are
placed in a shared folder. The import process works fine
as long as the flat files are all csv with double quote
text qualifier and no header.

Unfortunately, the files have a header sometimes (albeit
rarely). The DTS imports the header as a separate row in
the table and wrecks havoc with my subsequent SQL scripts

To add fuel to the fire, they sometimes do not have a
double quote text qualifier.

I'm trying to make the users standardize their flat files
to a fixed format but unfortunately they don't always
listen and play by the rules.

Please pass on ideas to resolve these issues. Also, ideas
on improving this whole process of frequently importing
flat files into SQL are appreciated.

Thanks,
Vinod.




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.