Looking for a Recommendation

vartyj
vartyj used Ask the Experts™
on
I need to design a program that access a SQL database once a week to compare a number of values and sends off emails based on what it finds. The emailing and SQL parts I have figured out, I'm curious as to what the experts here would recommend for how I should go about making a program run once a week.

Any suggestions or tips from projects you've done yourself? Should I find away to make a program run in the background and sleep for a week at a time, or is there another way to go about doing this?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
After developing the application, add the application to the standard windows task scheduler and schedule its time to run weekly. The exe will run at the specified time, collect the information and will send the mail.

For information regarding the Task Schedular refer to links below:
http://www.iopus.com/guides/winscheduler.htm
http://support.microsoft.com/kb/308569

Thx!
Swaps...
Most Valuable Expert 2012
Distinguished Expert 2018

Commented:
by SQL database I assume SQL Server?

I'm pretty much only Oracle but:  Oracle has the ability to schedule jobs and send emails all from within the database.  I do this every night.  My database emails me it's status based on column values and a few other things.

I can't believe SQL Server can't do something similar.  

A quick Google returned:
http://classicasp.aspfaq.com/email/how-do-i-send-e-mail-from-sql-server.html
Well if your application is database centric, I mean just the stored procedurel then you can run the stored procedure through the SQL agent Job in sql server.The agent is specifically designed to run the application periodically (monthly, daily, weekly).

But if your application is a console application then you can schedule it on regular windows scheduler.


hi vartyj,

My suggestion is to create a WINDOWS SERVICE and activate it using a scheduler (Scheduled Tasks).

Below are some links which will guide you, How to make a windows service...

http://www.c-sharpcorner.com/UploadFile/mahesh/window_service11262005045007AM/window_service.aspx
http://www.codeproject.com/KB/dotnet/simplewindowsservice.aspx
http://www.codeguru.com/vb/gen/vb_system/services/article.php/c4825/

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial