Tuesday, March 20, 2012

Bulk insert problem

Hey,

I am trying to do a bulk insert from a txt file. I am trying to allow the query to read the txt file off the users local computer. This is the code I am using:

BULK INSERT TbleTestBulk
FROM 'C:\westportela.dat'
WITH
(
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n'
)

I also tried this

BULK INSERT TbleTestBulk
FROM '\\host_name\C$\westportela.dat'
WITH
(
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n'
)

and this

BULK INSERT macomber
FROM '\\wcsserver\SSP\txt frm mms\WES.txt'
WITH
(
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n'
)

none work.

I basically get this error for each:
Server: Msg 4861, Level 16, State 1, Line 1
Could not bulk insert because file '\\wcsserver\SSP\txt frm mms\WES.txt' could not be opened. Operating system error code 53(The network path was not found.).

Anyone got any suggestions. I am really new to this so all help would be welcomed.

Thanks

MikeDid the client share that location?

Why not copy the file to the server...I would suggest that that is the preferred method...you would want to take the network out of the equation when loading or dumping data...

My own opinion (MOO) *

* Actually not really...it's in a few books I've read

No comments:

Post a Comment