Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


BULK INSERT AND FILE ACCESS DENIED ISSUE


BULK INSERT AND FILE ACCESS DENIED ISSUE

Author
Message
mymail.default
mymail.default
Valued Member
Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)

Group: General Forum Members
Points: 62 Visits: 258
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
Orlando Colamatteo
Orlando Colamatteo
SSCrazy Eights
SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)

Group: General Forum Members
Points: 8231 Visits: 14368
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
Tien Tran
Tien Tran
SSC Rookie
SSC Rookie (26 reputation)SSC Rookie (26 reputation)SSC Rookie (26 reputation)SSC Rookie (26 reputation)SSC Rookie (26 reputation)SSC Rookie (26 reputation)SSC Rookie (26 reputation)SSC Rookie (26 reputation)

Group: General Forum Members
Points: 26 Visits: 353
in addition to setting up delegation, I disabled the named pipe protocol on SQL server and it works perfectly
Mohammed Imran Ali
Mohammed Imran Ali
Valued Member
Valued Member (73 reputation)Valued Member (73 reputation)Valued Member (73 reputation)Valued Member (73 reputation)Valued Member (73 reputation)Valued Member (73 reputation)Valued Member (73 reputation)Valued Member (73 reputation)

Group: General Forum Members
Points: 73 Visits: 258
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).
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search