SQL Server Agent Question - Copying CSV file to a mapped Network Drive

  • Hi -

    Via SQL Server Agent Jobs, I'm running a .SQL script every day that creates a CSV file on the C: drive of the server that SQL server is running on.    How do I move that CSV file to a mapped network drive as the 3rd step of the job?     The error I'm getting is Drive not found or path doesn't exist.    Do I have to give \\servername\SQLSERVERAGENT user access to it?       I tried copying using the UNC path and I get the same error.   Thanks!

    Screenshot 2023-12-05 175345

    • You need to provide access to the target share or folder

      • to the sql agent service account

    OR

      <li style="list-style-type: none;">

     

     

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

  • As mentioned by Johan, Grant access to the network folder. If it is not in your control, ask your network admin to provide access to the sql agent service account.

    You can also test it by remotely logging on to the server and mapping the UNC path on the server as a test using the same user login/passwd.  Run the agent job or manually copy the file to that UNC path. Once test is done, you can unmap the network location on the server.

    =======================================================================

Viewing 3 posts - 1 through 2 (of 2 total)

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