Bulk Insert - ROWTERMINATOR value

  • Hi

    My Bulk Insert fails because I'm attempting to load a file from Unix where the end-of-line character is composed of '0A' (LF) not '0D0A' (CRLF) as in Windows, and my ROWTERMINATOR = \n (which presumably expects '0D0A').

    Is it possible to specify value of ROWTERMINATOR to be an '0A' or LF character?

  • One way I can think of is to use a conversion utility program (eg: 2dos) to convert the file format from unix to dos before doing the extraction.

    Or try this! Instead of specifying a row terminator, specify an exclusive column for the LF, with a character lenght, so that bulk insert treats it as a column. I'm not sure about the character length! Probably 1. Make this column dummy by specifying 0 on the column number.

    Hope this helps.

  • I experimented with various options and the one which worked was by specifying ROWTERMINATOR='char(10)'.

    CHAR(10) equates to the Line Feed character.

    Many thanks for your help.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply