sql server - Importing a CSV file without headers into SQL 2008 -


I want to import CSV with 4,8 M records in a SQL 2008 table. I'm trying to do it with the management studio wizard but it attempts to identify a top row that CSV does not have. I do not get any option to leave it, and although I specify the column itself, the wizard is now Also tries to find the header row and does not import anything without it

The structure of CSV

"818180", "25529", "diario", "Pereira", "Rosario", "SF", "2010-09-02" / P>

I have also tried options like bat INSERT but then I think bulk with INSERT, I can not import a file with a text qualifier.

The easiest way to import once is to "import data" function in SQL Server Management Studio Will happen. This will launch a wizard and will allow you to determine that you want to import your data - Select "Flat File Source" The next dialog allows you to browse the file that you want to import, You can specify all types of things on the dialog (such as encoding of files, what is the text qualifier - if any - and so on.>

You can leave any number (Like "Skip the first 5 rows"), or you can choose that the first row contains the column names.

If the first line in your file If the column name is missing, then uncheck that option.

If you have to make this import repeatedly, you can save all SQL Server (or external SSIS In the file) information about the import as a integration services package, and You can run that import again and again from the SQL Server Agent "Jobs" menu (Enable SQL Server Agent, already, and find the "Jobs" sub-item - you see all your jobs there And you can launch it again from that menu).

And if you want, you can launch this SSIS package code from your C # or VB.Net - see it or see it on the topic.


Comments