Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Automated service

Author  Topic 

dr S.A.f.
Starting Member

13 Posts

Posted - 2006-04-11 : 09:47:24
Hi,
I'm working on a program that is some kind of organizer for all the tasks that employees have to carry out. A part of this program should check the deadline from the tasks, and send a mail if the deadline is in less than 5 days.
I'm using asp .net 2.0 & sql server 2000
Can anyone tell me how I can do that, or put me on track with some key words to google for?
thx.

ravilobo
Master Smack Fu Yak Hacker

1184 Posts

Posted - 2006-04-11 : 10:46:01
1. A table with task and DEADLINE info.
2. A job which runs every day one time , having an SP to check whether the deadline < 5
3. Send the mail if the deadline <5

Hope this helps.

------------------------
I think, therefore I am - Rene Descartes
Go to Top of Page

dr S.A.f.
Starting Member

13 Posts

Posted - 2006-04-11 : 11:31:13
It's obvious that my first post was kinda blur :). I allready have the data in tables, and I more or less know how to get those mails sent, my only problem is that I have no clue what so ever on how to create a task that runs once a day, checks the condition execute some code and then goes to sleep again for 24hours or so without someone manually starting it every day.
but still, thx for the reply.

My first guess was to use triggers, but I learned (correct me If I'm way off here) that triggers only fire after an update, delete or insert event and not when a certain goal is reached (eg deadline > 5 days)
Is it possible to create such a task at database level, or should I ask my question again at an asp forum and search more in that direction?
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2006-04-11 : 11:35:46
Create a SQL Server Agent job, and schedule the job to run once per day.

Read SQL Server Books Online to see how to do this.



CODO ERGO SUM
Go to Top of Page

dr S.A.f.
Starting Member

13 Posts

Posted - 2006-04-11 : 11:46:46
thx very much.
Go to Top of Page
   

- Advertisement -