2

Following error occurs on running sql job.

Cannot bulk load because the file could not be opened. Operating system error code 5(Access is denied.). [SQLSTATE 42000] (Error 4861). The step failed.

Looks like permission error. Scenario is that Source File is located on Server-A and SQL Server is installed on Server-B. How can I give access to file. SQL User is not showing on below window.

enter image description here

1
  • You need to map the actual account that the OS level uses from Server B. Specifically, the account that actually executed the package. Then, it just be mapped to that Directory/file to be able to read/write. If the file is contained also inside SQL Server, that is another step.
    – clifton_h
    Commented Oct 21, 2017 at 19:41

1 Answer 1

2

in-order to access a file in another machine using SQL Server you may give permission to the Account which you have used to start your sql-server instance.

if you have active directory on your environment make sure to start sql-server instance with an active directory user and give required permission to to that user on "Server-A". Change the Service Startup Account for SQL Server

but if you do not have any active directory on your Environment the only way to do this is to have a user with the exact name and password of your sql-server service user on Server-A

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.