
the user (or security context) a sql job runs under varies based on how the job is launched. meaning you might have tested everything, and it's all working fine - only to find your scheduled task fails (with something along the lines of 'access denied').
this usually comes down to permission for the user the sql job runs under. you either need to adjust persmissions for a user, the sqlagent account, or the designated user the job runs under.
here are the different scenarios :
If you are logged in using a domain account that is in the sysadmin group and right click to start a job that job will run under the SQL context of the sysadmin and the Windows security context of that domain account.
If you are logged in using a domain account that is not in the sysadmin group and right click to start a job that job will run under the SQL context of the account under which SQLAgent is running.
If SQLAgent starts the job it will run under the security context of the owner of the job or under the context of the Run As selection on the job. If the owner or run as is a SQL login account (not a domain account) then the job will have no windows security context UNLESS a proxy account has been set up then it will have the windows security context of the proxy account AS LONG AS the account under which SQL Agent is running is in the local Administrators group on that machine (that is what gives it the permissions to use the proxy account).