Importing a CSV file using BULK INSERT command into SQL Server table

前端 未结 4 1677
野性不改
野性不改 2021-01-21 18:34

I have CSV file which have a couple of data columns.

The CSV file looks like

field1: Test1
field2: Test2
field3: Test3, Test4, Test5

4条回答
  •  长发绾君心
    2021-01-21 18:57

    This is the code for importing text or csv file into the database:

    String SQL = "BULK INSERT [staging_db].[dbo].[TEST] FROM 'D:\\test.txt' WITH (FIELDTERMINATOR = ',',ROWTERMINATOR = '\n')";
    

提交回复
热议问题