Bulk insert, SQL Server 2000, unix linebreaks

后端 未结 8 938
旧时难觅i
旧时难觅i 2020-12-13 13:05

I am trying to insert a .csv file into a database with unix linebreaks. The command I am running is:

BULK INSERT table_name
FROM \'C:\\file.csv\' 
WITH 
( 
         


        
8条回答
  •  伪装坚强ぢ
    2020-12-13 13:47

    I confirm that the syntax

    ROWTERMINATOR = '''+CHAR(10)+'''
    

    works when used with an EXEC command.

    If you have multiple ROWTERMINATOR characters (e.g. a pipe and a unix linefeed) then the syntax for this is:

    ROWTERMINATOR = '''+CHAR(124)+''+CHAR(10)+'''
    

提交回复
热议问题