sql agent job output file to different server has error

  • I have a SQL agent job that selects from a table and using the advanced options I can send the results to a test file. It works fine. But I'd like to send the file to a different server and am getting an error: "Executed as user: MGH\sqlagent. Unable to open Step output file. The step succeeded."

    I added permission for the sql agent service account on the other server. I'm using output path like: \\servername\foldername\filename.txt

    Is that syntax correct? Am I missing some permission on the other server?

    Thanks very much for any help.

  • Your MGH\sqlagent should have full-control access to the folder on your "different server".

    Also, check if you can ping your "different server" from the SQL one.

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • Make sure the SQL Server service account has access to the share. If your agent job is running as a sysadmin user it actually runs in the context of that service account, not as the agent service account.

    Jeffrey Williams
    “We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”

    ― Charles R. Swindoll

    How to post questions to get better answers faster
    Managing Transaction Logs

  • I can ping the other server from the server where the job runs. I have added full control to the share file on the other server where I want the file to go. For the sql agent and the sql server service accounts. Still same error. Thanks for the ideas. Will continue to try.

  • I found the problem. I had to put the drive letter in the path name. Like:

    \\servername\d$\foldername\filename.txt

    Thanks to everyone for taking the time to help me with this.

  • Denise McMillan (3/18/2013)


    I found the problem. I had to put the drive letter in the path name. Like:

    \\servername\d$\foldername\filename.txt

    Thanks to everyone for taking the time to help me with this.

    That tells me the folder in question here is not a shared folder. And, you added the service accounts as local administrator on the system where that folder exists.

    Using the administrative share in this manner will work, but it is not the recommended approach. I would recommend that you review the folder and make sure it is shared with appropriate rights for each user - and change the path to the shared folder path.

    Jeffrey Williams
    “We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”

    ― Charles R. Swindoll

    How to post questions to get better answers faster
    Managing Transaction Logs

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply