Bulk insert rowterminator issue Bulk insert rowterminator issue php php

Bulk insert rowterminator issue


I think problem is that your csv file uses \n as EOL (unix way). BULK INSERT in SQL Server is "smart" and even if you specify ROWTERMINATOR as \n, which in theory should resolve your problem, it prepends it with \r so you end up with \r\n as row terminator.

Try using ROWTERMINATOR='0x0A'. In this case SQL Server doesn't perform any magic tricks and just uses the value you've set as row terminator.
Works for me. :)


CHAR(124) is | and CHAR(10) is \n

You probably need CHAR(13) and CHAR(10) as Row Terminator

http://www.techonthenet.com/ascii/chart.php