Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

BULK INSERT AND FILE ACCESS DENIED ISSUE Expand / Collapse
Author
Message
Posted Thursday, February 17, 2011 10:24 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Thursday, March 27, 2014 11:01 AM
Points: 60, Visits: 226
Hello everyone,

Little stumped with this problem trying to do a bulk insert into a table and it was working fine for a while and suddenly started giving this:

Cannot bulk load because the file 'file.txt' could not be opened. Operating system error code 5(Access is denied.)

I checked the SQL Service account to have permissions to this file.

With some testings, I found that if I run the bulk stmt. as a "sa" user, it works ok, however, when I run it as a windows domain user(which has all the permissions on the file), it fails with the error.

Any ideas why it this is so?

Thanks
Post #1065834
Posted Thursday, February 17, 2011 11:06 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 7:44 PM
Points: 7,107, Visits: 12,661
See the section on Permissions in the BOL article for BULK INSERT:

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


__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Post #1065871
Posted Thursday, December 20, 2012 8:42 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Yesterday @ 12:29 PM
Points: 26, Visits: 258
in addition to setting up delegation, I disabled the named pipe protocol on SQL server and it works perfectly
Post #1399162
Posted Thursday, December 20, 2012 8:48 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Thursday, June 12, 2014 1:09 AM
Points: 72, Visits: 251
mymail.default (2/17/2011)

I checked the SQL Service account to have permissions to this file.


Check if the SQL Server Agent service account has access to this file (and location).
Post #1399164
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse