Link to home
Start Free TrialLog in
Avatar of Rob132332
Rob132332Flag for United States of America

asked on

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

SOLUTION
Avatar of mohan_sekar
mohan_sekar
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Rob132332

ASKER

mohan - could you give me some more info to check what you're suggesting?  steps, things to check?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of Anthony Perkins
Anthony Perkins
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
and, how would I check that the SQL Server Service startup account has access?
You either check it yourself or ask your DBA.
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.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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