Question

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.

Was it helpful?

Solution

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.

OTHER TIPS

I experienced this error, too.

In my case the solution was to change the path in T-SQL from a share to the actual directory: \\server\share$\file -> drive:\folder\file.

The culprit ended up being a problem with VMWare, which caused the server to have trouble authenticating with some network shares.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top