Sunday, March 25, 2012

Bulk Insert ZERO rows returned...

I have poured thru notes, sites, etc. and can't seem to figure what I might be doing wrong - which most likely is something very easy.

BULK INSERT

dbo.tbCheckpoint

FROM 'c:\inetpub\wwwroot\upload\maxie_task_aging.csv'

WITH

( DATAFILETYPE = 'char', FIELDTERMINATOR = ', ',

FIRSTROW = 3, KEEPNULLS, ROWTERMINATOR = '\t\n')

I am doing a bulk insert where I am pulling from .csv but the msg I get when running it is

(0 row(s) affected)


There is data in the file, it starts on the 3rd row and terminators are set correctly.

Any thoughts?

Moving to the transact-SQL forum.|||Have you checked to see if the .csv file ends with a carriage return/line feed? I have seen cases where the insert would fail because the csv, as a whole, was not terminated properly. It's definitely worth a "look see", so to speak. If the file is missing a carriage return, add it, then try the import again.|||Thanks! That was it.

No comments:

Post a Comment