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 2008 Forums
 SSIS and Import/Export (2008)
 Cannot bulk load because the file cannot be opened

Author  Topic 

Spawn10
Starting Member

2 Posts

Posted - 2010-11-12 : 11:06:02
I keep getting an error that states..."Cannot bulk load because the file "\\myPath\...\logger.txt" could not be opened."

I am getting this while trying to do a bulk insert in my procedure...here is what my code looks like...any help is much needed as I have been looking at this for a while now. I used the PRINT to look at the parameter being passed in, and it looks right.
I have checked to make sure that I have admin permissions on the file, I am also pointing to a location that is on the server and not on my local machine.
I am out of ideas...please help...Thanks





USE [myDB]

GO

/****** Object: StoredProcedure [myStoredProc] Script Date: 11/11/2010 11:15:59 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO



ALTER PROCEDURE [myStoredProc]

@SourcePath varchar(100),

--@FormatFilePath varchar(100)



AS

SET ANSI_WARNINGS OFF





DECLARE @str_command nvarchar (150)

SET @str_command = 'BULK INSERT [histTable] FROM ''' + @SourcePath + ''' WITH (FIELDTERMINATOR = '','') '


PRINT @str_command

EXEC SP_EXECUTESQL @str_command

X002548
Not Just a Number

15586 Posts

Posted - 2010-11-12 : 11:35:49
where is the file located? My guess is that it's not on the server



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page

Spawn10
Starting Member

2 Posts

Posted - 2010-11-12 : 12:28:04
I get the error if the log file is either on my machine or the server. For trouble shooting sake, i have been working with the file that is on the server.
So I tried that to eliminate the location of the file option.
Go to Top of Page

elwoos
Master Smack Fu Yak Hacker

2052 Posts

Posted - 2010-11-15 : 06:04:24
Does another process have the file open?

-----------

I used to think I wasn't a morning person but it never got better in the afternoon
Go to Top of Page
   

- Advertisement -