1

I'm trying to get the SQL agent job (task) to run my query then put the output file to network drive. When I select the output file the only drives listed are local. I'm new to jobs and MSSQL but have a good knowledge of MySQL.

If I choose a local disk the job completes just fine. If I manually put the drive letter of the mapped drive in the output file field nothing happens.

Thanks

1 Answer 1

1

In windows, drive mappings are on a user account basis. This means that the user account that the SQL Agent runs under can't see drive mappings made by a different user (like the account used to administer the server).

A workaround is to use a UNC path name to point to the share. Just type in whatever file path you like into the "Output File:" field in the Job Step Properties dialog box. You might want to dream up some sort of naming convention to keep server names, job names and steps straight. Something like: \superbigfileserver\sqllogshare\sqlagentlogs\dbinstancename\a_sql_job_name.step_number.txt

Of course, the account used for SQL Agent should have sufficient permissions to access the relevant share, path and file.

If you are worried about the name of the file server changing, set up a CNAME via DNS and use that name instead of the "real" file server name.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .