Join 136,933 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,851 people online right now. Registration is fast and FREE... Join Now!
I am currently creating a console application for the company I work for. The job of this small application is to handle tasks at a certain time each day; send email notifications, handle reoccurring billing, certain logging functionality, etc. I'm not wanting to have it run 24/7 and am wanting to schedule it to run at certain times of the day for certain activities. I want it to open, perform the tasks (according to the command line arguments passed to it), log the activity in the System Event Log, then close.
Now to my question. Would it be better to use the built in scheduling agent in Windows, create a SQL DTS Package, or possibly use a 3rd party scheduling program to schedule this. I am kind of leaning towards the SQL DTS Package, but am open to ideas and suggestions.
It's a 2003 Server, thanks for the advice. I'm also going to check into a DTS package and see which is more efficient. If I go with a DTS Package Ill have to change it once I make the upgrade to SQL 2005 as DTS doesn't exist in 2005 so thats something for me to think about as well.
I cant believe I never thought of a Windows Service. I think that may be a route I go, at least I'm going to look at it. Since Ive never done a Windows Service, you can pass command line arguments to it right?
What it sounds like you need is an equivalent to a cron job in linux. I don't know what the equivalent is in windows. It is probably the default task scheduler.
Very good find skaoth, and the comments are even better after the entry! There are some really good thoughts on when you should use a service and when a scheduled task, since both have their cons and pros.
That is a great find indeed. I think for the time being, since at this exact point it only has a single task: Send email notifications once a day. Eventually it will handle many tasks, email notifications, reoccurring billing tasks, advanced logging, etc. I think at that point I may want to look at a Windows Service (well I'm going to be developing the service concurrently with the Console Application). But since for the time being it will handle but a single task I will go with the Console Application as a scheduled task.