You are here: Re: Import multiple csv into multiple tables « MsSQL Server « IT news, forums, messages
Re: Import multiple csv into multiple tables

Posted by Erland Sommarskog on 08/09/06 22:25

Chicagoboy27 (jeremy.bird@gmail.com) writes:
> Is there a way to import multiple csv files from a directory into sql
> 2005? The situation I have right now is that I have a folder with
> multiple csv files that i need to import into sql 2005. I can do it
> with the import wizard but it takes to long. The files will be updated
> monthly. The first row in the files contains all the header information
> which may change monthy. What I am looking to do is import all of these
> csv into tables. One csv file into for one table. Ideally I would like
> to use the name of the csv file as the name of the table. Any bump in
> the right direction would be apprecieted

You could use BCP or BULK INSERT, but it appears that you would have to
add quite some control code on top that.

A better alternative could be to turn to SQL Server Integration Services,
which is what the Import Wizard uses. Unfortunately, though, I am
completely unexperienced myself with SSIS, so I cannot assist further.


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация