how to fix bulk insert issue

Biniam Ashami 0 Reputation points
2024-03-19T16:38:35.3433333+00:00

cannot bulk load because file "\mynetwork\fiel\myfile" could not be opened. Operating system error code 5 (access is denied)
my job which bulk inserts from the above mentioned source used to work fine. But lately, I see this error. Nothing has changed from SQL server side. If I ran the code from ssms it yeilds an output but the job fails by throwing the error I wrote above

SQL Server Transact-SQL
SQL Server Transact-SQL
SQL Server: A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.Transact-SQL: A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
101 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Abubakar Riaz 1 Reputation point Student Ambassador
    2024-04-07T07:29:53.7066667+00:00

    That is the classic access issue. the job agents run with a different user. go to the SQL configuration manager to see which user is being used for running the SQL agent. Then, give access to that user—simply said than done. so I suggest another way. first, go to the network link to the file you are using for upload. give that path/file the 'everyone' access and run the job, if this fixes the issue then it's an access issue. so now you only need to give access to the user from which the job agent is running.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.