Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Error msg 4860

Author  Topic 

Dibs
Starting Member

2 Posts

Posted - 2003-01-10 : 09:47:23
Hi

Using the procedure available in the article "Using BULK INSERT to Load a text file" (ItemID 3207) I am trying to load a text file. However, when I try to execute it, the following error is generated:

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

The file TxtFile1.txt does exist in the specified directory so I cannot understand why this is being produced. Can anyone offer me an explanation/solution??

Cheers
Adrian.

nr
SQLTeam MVY

12543 Posts

Posted - 2003-01-10 : 10:04:25
Is it on the correct server?
Not sure how dts handles bulk inserts (as I can't think of a good reason to use it for them) but I suspect this will be relative to the server rather than the client.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

AjarnMark
SQL Slashing Gunting Master

3246 Posts

Posted - 2003-01-10 : 15:14:47
Could also be a permissions issue at the OS level...

------------------------------------------------------
The more you know, the more you know you don't know.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2003-01-10 : 15:59:19
BULK INSERT requires that the file be located on a local drive on the server, so you will need to copy the file to the server. This is why I prefer bcp (or even DTS, but usually bcp).


Edited by - tduggan on 01/10/2003 15:59:45
Go to Top of Page

jasper_smith
SQL Server MVP & SQLTeam MVY

846 Posts

Posted - 2003-01-11 : 11:57:16
BULK INSERT works fine with remote files, you just specify a UNC path. For the original problem, if running this through Query Analyzer against a remote server i.e. not a local install of SQL Server on your workstation, then make sure the 'c:\TxtFile1.txt' is on the c drive of the SERVER not your workstation. The opposite is true if running a DTS package via EM on your PC. DTS designer is a client side tool and the c drive will refer to your local PC. This is a common reason why packages that run from EM fail as jobs, the files referred to are not available on the server (the next common problem being permissions).


HTH
Jasper Smith
Go to Top of Page
   

- Advertisement -