I have dome something like this before by putting logic into the code you are calling to verify if it's in that range and just schedule to run everyday and if it's in that range execute, otherwise exit out gracefully?
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
You need access to SQL Server Agent in order to do what you need to do. This is done through
msdb
permissions:SQLAgentUserRole
,SQLAgentReaderRole
, andSQLAgentOperatorRole
.You can create a job to adhere to your schedule, and then the job will execute whatever task it is that you need done.
As for the performance impact on the server, SQL Server Agent itself is negligable but whatever the job does will definitely be a consideration on when it is run, depending on how expensive the job is. To give a better estimate on server impact, please tell us exactly what you need the job to do.