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
 General SQL Server Forums
 New to SQL Server Administration
 BULK INSERT C: file not found

Author  Topic 

bobk544
Starting Member

6 Posts

Posted - 2009-06-05 : 14:55:39
Hello when i try to BULK INSERT a file on my C: drive, SS2005 remote server says it can't find the file

USE [zyxmodel];
GO

BULK INSERT
zzzz_xxxxxx_wwwww
FROM "C:\_aaa\bbbb\cccc\ddddd.dat"
WITH (FIELDTERMINATOR = '|')
go

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-06-05 : 16:02:35
That's because the file doesn't exist on the C drive of the remote database server. If you can't copy it to the remote database server, then use a UNC path to your local machine. Note that this will require that the SQL Server service account have access to your machine.

Alternatively you could use bcp.exe, which would mean it can get to your C drive directly.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

bobk544
Starting Member

6 Posts

Posted - 2009-06-05 : 16:11:59
Thanks alot Tara, i'm going to look into that bcp.exe cos i heard someone ask about that the other day and maybe that's another clue!

Have a nice weekend appreciate your thoughtful help!
BobK
Go to Top of Page
   

- Advertisement -