Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

BULK INSERT - COMMA DELIMITED FILE TO SQL SERVER FAILS ON ROW TERMINATOR

$
0
0

I am attempting to import a comma delimited text file into sql server using the bulk insert script

BULK
INSERTCSVTest
FROM'c:\csvtest.txt'
WITH
(
FIELDTERMINATOR=',',
ROWTERMINATOR='\n'
)

However the row terminator keeps failing.

I have used a variety of different terminators and the following terminator works

'0x0a'

However, it imports only the first row in my data which is better than the previous terminators that completely fail however this does not resolve my issue because the script has to be used continuously over several files


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>