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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Send Email on Birthdays

Author  Topic 

demods
Starting Member

6 Posts

Posted - 2005-03-15 : 03:59:27
Hi,

I don't know if this this is the right section but I have a problem with SQL Server programming.

I have a table named TBL_MEMBERS and it holds the users birthdates in BIRTHDATE (datetime) field. What I want to do is to schedule SQL Server daily at midnights and check if there are members born on that day. If there are members then send them a HTML mail template.

I don't know how to program SQL Server for this job. If anyone can help me, I will be very pleased.

Thanks...

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2005-03-15 : 04:42:55
create a job, scheduled daily, queries through your tbl_members, then sends the email?

--------------------
keeping it simple...
Go to Top of Page

demods
Starting Member

6 Posts

Posted - 2005-03-15 : 04:52:01
That's exactly what I want to do. But there is a little problem, HOW? :)

Thanks...
Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2005-03-15 : 04:55:29
quote:
Originally posted by demods

That's exactly what I want to do. But there is a little problem, HOW? :)

Thanks...



check sp_add_job or just add a job using the wizard in enterprise manager

--------------------
keeping it simple...
Go to Top of Page

demods
Starting Member

6 Posts

Posted - 2005-03-15 : 06:14:01
What I want is a from-top-to-toe tutorial;

1. Check birthdays SP (from TBL_MEMBERS table, BIRTHDATE field)
2. Email them to the member SP (from TBL_MEMBERS table, EMAIL field)
3. Let SQL Server do this job daily (Job Scheduling, daily at 00:00)

Now, what I couldn't do is;
1. Check birhdays SP
2. Email to the members SP

I can handle Job Scheduling but I need these two stored procedures to define a daily job.

I found an article about this subject at; http://www.aspfaq.com/show.asp?id=2403 . I do everything s/he tells. I don't get any errors from SQL Server Job History but mails don't come to me.

This article (http://support.microsoft.com/default.aspx/kb/263556) also explains how to configure SQL mail.

There is something wrong with the procedures I follow but I don't know which one is wrong.

Any help is appreciated.

Thanks...
Go to Top of Page

demods
Starting Member

6 Posts

Posted - 2005-03-15 : 06:48:35
OMG, I found this article and I solved my problems,

http://www.sql-server-performance.com/forum/topic.asp?TOPIC_ID=4193

Thanks jen for your help also...
Go to Top of Page
   

- Advertisement -