I setup up a sql server agent job to run a batch file that does nothing more than copy some files from a network location to a share on the local SQL server where the batch job is scheduled to run.
My only step in the job is of type Transact-SQL and is as follows:
exec xp_cmdshell '\\grcsql\offsitebackup\offsite.bat'
When the job runs through SQL server agent it is failing due to access being denied (I tested using query analyzer). The batch job is:
copy \\grcmfs1\docfiles\MANS\thomas\39tb01_.XLS \\grcsql\offsitebackup\staging\39tb01_.XLS
If I run the batch job manually, everything works .... So my question is, when the Sql server agent job runs, with what account does it try to access the network path? I have changed the job owner and it doesn't seem to make a difference. Is it using the Sql server agent starup account?
My only step in the job is of type Transact-SQL and is as follows:
exec xp_cmdshell '\\grcsql\offsitebackup\offsite.bat'
When the job runs through SQL server agent it is failing due to access being denied (I tested using query analyzer). The batch job is:
copy \\grcmfs1\docfiles\MANS\thomas\39tb01_.XLS \\grcsql\offsitebackup\staging\39tb01_.XLS
If I run the batch job manually, everything works .... So my question is, when the Sql server agent job runs, with what account does it try to access the network path? I have changed the job owner and it doesn't seem to make a difference. Is it using the Sql server agent starup account?