If I want to conduct some database operations on a scheduled basis, I could:
-
Use SQL Server Agent (if SQL Server) to periodically call the stored procedure and/or execute the T-SQL
-
Run some external process (scheduled by the operating system’s task scheduler for example) which executes the database operation
-
etc.
Two questions:
- What are some other means of accomplishing this
- What decision criteria should one use to decide the best approach?
Thank you.
I think the best approach for the decision criteria is what the job is. If it’s a completely internal SQL Server task or set of tasks that does not relate to the outside world, I would say a SQL Job is the best bet. If on the other hand, you are retrieving data and then doing something with it that is inherently outside SQL Server, very difficult to do in T-SQL or time consuming, perhaps the external service is the best bet.