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)
 how to create a stored procedure

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-04-27 : 09:04:09
prabu writes "how to Create a stored procedure to trigger email to a list of
users to remain them that their message is
going to be inactive state in next 5 days. The SQL should take
all the messages that are 25 days old user's. How to check this?

can any one help me in this. The date which the message posted is in string datatype."

derrickleggett
Pointy Haired Yak DBA

4184 Posts

Posted - 2004-04-27 : 09:38:53
Can you give us more information on this? What is your table structure? What does the data look like?

You can use a SQL Server job to execute a query every day. The query can then use xp_sendmail to send mail to the appropriate people.

It's generally recommended that email be done from the application. You can use a SQL Server query to determine who you need to email and what the message needs to be. You would then have an email component that would email the appropriate people. Make sense?

If you decide to do it in SQL Server, post the structure and some sample data.

MeanOldDBA
derrickleggett@hotmail.com

When life gives you a lemon, fire the DBA.
Go to Top of Page
   

- Advertisement -