Nate Pet Nate Pet - 6 months ago 54
SQL Question

Sql Bulk Insert -- File does not exist

I have the following query to insert into a table

BULK
INSERT tblMain
FROM 'c:\Type.txt'
WITH
(
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n'
)
GO


It get the message


Msg 4860, Level 16, State 1, Line 1

Cannot bulk load. The file "c:\Type.txt" does not exist.


The file is clearly there. Anything I may be overlooking?

Answer

Look at that: Cannot bulk load. The file "c:\data.txt" does not exist

Is that file on the SQL Server's C:\ drive??

SQL BULK INSERT etc. always works only with local drive on the SQL Server machine. Your SQL Server cannot reach onto your own local drive.

You need to put the file onto the SQL Server's C:\ drive and try again.