Import CSV file without headers in SQL 2008

I want to import CSV with 4.8M records into a SQL 2008 table. I am trying to do this using the Management Studio wizard, but it is trying to recognize a header row that is not in CSV. I don’t see the possibility to skip this, and although I specify the columns myself, the wizard is still trying to find the header row and does not import anything without it.

CSV structure makes up

"818180", "25529", "Dario", "Pereira", "Rosario", "SF", "2010-09-02"

I also tried alternatives such as BULK INSERT, but then I found out that with BULK INSERT I cannot import files using the text classifier.

+3
source share
2 answers

The simplest one-time import method would certainly be the Import Data feature in SQL Server Management Studio. This will launch the wizard and allow you to determine where you want to import your data - select "Flat File Source". In the next dialog box, you can find the file you want to import, and in this dialog box you can specify all kinds of things (for example, the encoding of the file, which text specifier, if any), etc.

You can also skip any number of rows (for example, “skip the first 5 rows”) or choose to have column names in the first row.

alt text

If your file does not have column names in the first row, clear this option.

, Integration Services SQL Server ( SSIS), "" SQL Server ( SQL Server, , "" - ).

, SSIS # VB.NET - CodeProject .

+5

Source: https://habr.com/ru/post/1745648/


All Articles