SQL Server 2000 Stored Procedure - Operating system error code 5(Access is denied.).

Hi - I'm receiving an error in a SQL Server 2000 Stored Procedure using Bulk Insert.  

Here's the error:

"Could not bulk insert because file '\\server\<path>\file.txt' could not be opened. Operating system error code 5(Access is denied.)."

This has worked for several years, and it appears that there were some recent changes made that is causing this error.  If I log into the database server, I can get to the file path in question, so even though the message says "Access is denied" I'm not convinced that is the issue.

Has anyone seen this before?

Thanks.
Rob


BULK INSERT ProcedureName 
FROM '\\server\<path>\file.txt'
WITH (
   FIRSTROW = 2,
   DATAFILETYPE = 'char',
   FIELDTERMINATOR = '\t',
   ROWTERMINATOR = '\n',
   MAXERRORS = 1
 
)

Open in new window

LVL 11
Rob132332Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Anthony PerkinsConnect With a Mentor Commented:
Or to be more precise since you are using BULK INSERT that the SQL Server service startup account has access to those files and is not a Local System account.
0
 
mohan_sekarConnect With a Mentor Commented:
Are you sure your procedure has access to that folder/file?
0
 
Rob132332Author Commented:
mohan - could you give me some more info to check what you're suggesting?  steps, things to check?
0
What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

 
mohan_sekarConnect With a Mentor Commented:
If the txt file is in a shared folder on a different server, check if 'read' permission is granted to your user id

for more info - http://social.msdn.microsoft.com/Forums/en-US/transactsql/thread/137d2f16-bed3-4b98-a16f-f6db1a961c46
0
 
Rob132332Author Commented:
and, how would I check that the SQL Server Service startup account has access?
0
 
Anthony PerkinsCommented:
You either check it yourself or ask your DBA.
0
 
Rob132332Author Commented:
After re-reading my last response, it was unclear.  
I'm asking "how" I would check it myself.  Specific steps would be great, as I'm not familiar with how to do this.  
Thanks.
0
 
Anthony PerkinsConnect With a Mentor Commented:
Look for the SQL Server (MSSQLSERVER) service and see what account is being used?  For example is it a Local System account, is it a domain account?
0
 
Rob132332Author Commented:
That did it - the account that was listed under the MSSQLSERVER service did not have permissions to get to the necessary network path.  Thanks for your help.  Rob
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.