Note: SQL Server Agent itself does not access the share
It depends on how you have mapped linked server security between local and remote credentials. SQL Server Agent running as local system will connect to SQL Server, which then accesses the share based on linked server credentials.
SUSER_SNAME will be different of course in this case to when you run it.
Options:
- add a linked server login mapping for "local system"
- configure all local credentials to use one remote login
- look at SQL Server Agent proxy accounts for the job step (changes SUSER_SNAME)
Although you don't mention it in the question, I assume that the reason you're using an SSIS package rather than simply executing the stored proc from a SQL Agent job is that there are other steps in the process. My other assumption is that you schedule the SSIS package using a SQL Agent job.
The first error message implies that you are creating an OLEDB connection to your Access database but that the database could not be found. It's possible that this is a security problem, and that the Windows account under which the SSIS package is running does not have permissions to the file system location where the Access database is stored.
The second error message seems to back this up - when executing the SP, the linked server connection could not be opened.
To confirm this as the issue, you need to try running the SP in SSMS using the same account under which the SQL Agent service runs.
If this is the problem, you will need either to change the permissions of the SQL Agent service account to allow access to the target location, or copy the access db to a location that the account can access (possibly the local disk) before running the package.
EDIT - in response to additional details:
Now that permission and Networked Drive are mentioned, I think this
may be the problem. However, I am still confused as to why I am able
to manually execute the Stored Procedure from within SQL Server with
the Access DB on a Network Drive?
The Acess linked server is configured to use the security credentials of the account executing the query. When you execute the procedure from SQL Server Management Studio, you are doing so in the context of your Windows account, which must have permissions to the network share.
When the same query is executed by the SQL Agent service, it uses the security context of the service account under which the service is running, which does not have access to the share.
Finally, how can I apply this suggestion? Meaning where in SQL Server
do I configure this feature:
change the permissions of the SQL Agent service account to allow access to the target location
You can find out and change the account under which the SQL Agent service is running in the SQL configuration manager (should be found under Start > All Programs > Microsoft SQL Server 2008 > Configuration Tools. Find "SQL Server Agent" in the list of SQL Server Services and see the "Log On As" column). You may need to switch this to a domain account to get access to the share.
Best Answer
Since the jobs will run as your SQL Server Agent account, that's the way to go: http://msdn.microsoft.com/en-us/library/ms187658.aspx
It is a best practice to run your SQL Server engine and your Agent under different accounts however, the logic being if one account is locked or otherwise compromised, you aren't hurting the other. To change your Agent account: http://msdn.microsoft.com/en-us/library/ms191543.aspx