Path Not Found - BULK Insert into SQL Server via VMWare Fusion

mikebmassey picture mikebmassey · Dec 28, 2011 · Viewed 14.4k times · Source

My machine is a macbook pro. However, my company's data is in SQL Server. In order to access it, I need to use VMWare Fusion to run SQL Server Management Studio 2008 on Windows XP.

When I attempt to run a bulk import (via instructions from SQLAuthority.com), I get this error:

Msg 4861, Level 16, State 1, Line 1
Cannot bulk load because the file "H:\test.CSV" could not be opened. Operating system error code 3(The system cannot find the path specified.).

I am dealing with 3 different file locations, but none of them work.

  1. My Mac storage - "/Users/Admin/Documents/test.CSV"
  2. My Windows XP storage - My "C:" drive. "C:\test.CSV"
  3. My company's network location - Mapped to the "H:" drive via Windows XP. "H:\test.CSV"

Changing the script to point to all these locations provides the same error message.

Any thoughts on how to overcome this? Presently, my only alternative is to use the SQL Server Import/Export tool, but it takes a while to setup every import. Script is faster.

Answer

Andomar picture Andomar · Dec 28, 2011

A bulk insert runs from the server. So it can't reach your local disk.

The server uses the account that the "SQL Server" Windows service uses. That account typically does not have any mapped drives.

Try using a full name, like:

\\server\share\test.csv

Possible other solutions:

  • Ask a DBA to open a share on the server for imports
  • Ask a DBA to place the CSV file on a disk on the server
  • Ask the DBA which account is used for the SQL Server service. If it's a domain account, you can give the account read rights on a network share.