944,014 Members | Top Members by Rank

Ad:
  • MS SQL Discussion Thread
  • Unsolved
  • Views: 4861
  • MS SQL RSS
Aug 29th, 2005
0

database reminders

Expand Post »
Hi,
I have a database table which has a Field called birthday.I want to write SQL script which automatically search database every day and if someones birthday equal today then display a reminder(alert).how can I do this? can anyone help me?

Thanks,
aish. :o
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
aish is offline Offline
26 posts
since Aug 2005
Sep 7th, 2005
0

Re: database reminders

Hi Aish,

There are several questions you would need to consider and answer before anyone can really help you get going in the right direction....

1) How do you want to be notified... e-mail? pop-up window? Text mail to your phone?

2) How do you want this triggered? In other words, Do you want the date check to run at 12AM every day? Or would you rather it only run when you log on to your workstation?

3) What machine is going to trigger it... the SQL server or your workstation? (Or do you have only one machine that is always on?) If you run it on the server, what do you want it to do with your notification if your workstation is not online (not an issue if you are emailing the notice)?

There are two sides of this see-saw:

If you run it on the server, triggering the event is easy, but sending the notice out gets a bit more complicated, whether using SQLMail or coding your own CDO or CDONTS (or other object) script .....

If you run it on your local workstation, especially in your login or startup script, then triggering the check and posting the notice is very easy, but getting the information from the database becomes the more difficult part requiring ODBC connections and some local scripting.

The prefered method would be to have the server trigger it at a specified time each day, and send an email to a email address that you can change as necessary.

If you can answer the above questions, I'll see how much more I can help.

:mrgreen:

Elohir
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Elohir is offline Offline
20 posts
since Aug 2005
Nov 17th, 2005
0

Re: database reminders

Hi,
I have a database table which has a Field called birthday.I want to write JSP using My SQL which automatically search database every day and if someones birthday equal today then display a reminder(alert).how can I do this? can anyone help me?

Thanks,
rishit
Reputation Points: 10
Solved Threads: 0
Newbie Poster
rishit is offline Offline
1 posts
since Nov 2005
Nov 19th, 2005
0

Re: database reminders

Ok Elohir, these are my answers,

1) How do you want to be notified... e-mail? pop-up window? Text mail to your phone?
I woluld like to send email

2) How do you want this triggered? In other words, Do you want the date check to run at 12AM every day? Or would you rather it only run when you log on to your workstation?
I want to date check to run at 12AM every day if I log or not

3) What machine is going to trigger it... the SQL server or your workstation? (Or do you have only one machine that is always on?) If you run it on the server, what do you want it to do with your notification if your workstation is not online (not an issue if you are emailing the notice)?
My project is webbased project I use web server and the sql server
Reputation Points: 10
Solved Threads: 0
Light Poster
aish is offline Offline
26 posts
since Aug 2005
Nov 20th, 2005
0

Re: database reminders

Quote originally posted by aish ...
Ok Elohir, these are my answers,

1) How do you want to be notified... e-mail? pop-up window? Text mail to your phone?
I woluld like to send email

2) How do you want this triggered? In other words, Do you want the date check to run at 12AM every day? Or would you rather it only run when you log on to your workstation?
I want to date check to run at 12AM every day if I log or not

3) What machine is going to trigger it... the SQL server or your workstation? (Or do you have only one machine that is always on?) If you run it on the server, what do you want it to do with your notification if your workstation is not online (not an issue if you are emailing the notice)?
My project is webbased project I use web server and the sql server

i think the best way to tackle this is to make a stored proc that does the check and put the details of the birthday people in a temp table, once you've got them all use xp_sendmail to send the email.

then in enterprise manager find 'jobs' (in management|sql server agent) and make a job that is run once per night and have it execute your stored proc

you could do this by just puttin the body of your stored proc in the job but its neater to do it that way
pty
Reputation Points: 64
Solved Threads: 39
Posting Pro
pty is offline Offline
530 posts
since Oct 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in MS SQL Forum Timeline: search
Next Thread in MS SQL Forum Timeline: Compare two tables





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC