Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"Bulk Insert" cannot find my text file

Status
Not open for further replies.

dgerdner

Programmer
Mar 30, 2005
41
US
have a database on a network server, and I wish to import text files into that server. My command (in SQL Server Management Studio Express) is as follows:

bulk insert dba.r_attorney_fees from "c:\abc.txt" WITH (FIELDTERMINATOR = '","')

I receive the error message:

Msg 4860, Level 16, State 1, Line 1
Could not bulk insert. File 'c:\abc.txt' does not exist.

However, the file definitely DOES exist. This is my first attempt to use bulk insert, so it appears there is something very fundamental that I don't understand. Is it perhaps looking on the database server instead of my local PC?

 
Okay.....so if I don't have access to the server, so I cannot copy my files there, do I have any way of importing them from my PC?
 
You'll need to make what ever account that is running the SQL Server an admin on your machine. Then use the UNC path to your C drive via the admin share.

Code:
bulk insert dba.r_attorney_fees from "\\WorkStationName\c$\abc.txt" WITH (FIELDTERMINATOR = '","')

If you don't have admin rights to your workstation it isn't going to work. You'll need to have someone put it on the server for you. Or use DTS to import the data.

Denny
MCSA (2003) / MCDBA (SQL 2000) / MCTS (SQL 2005) / MCITP Database Administrator (SQL 2005)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top