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)
 SQL Mail from trigger.

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-07-01 : 07:56:52
Skip writes "Can you create a trigger that sends an email on an insert with values from two different tables in the body of the message?

Can a stored procedure be developed which scans a table, compares a date with the current date and sends an email if older than X days?

Is SMTP called from within a trigger or stored procedure using the CDONTS object preferred over SQL Mail?"

AjarnMark
SQL Slashing Gunting Master

3246 Posts

Posted - 2002-07-01 : 14:48:52
Yes. Yes. Sometimes.

Beware of creating a trigger that sends email, or does any other "outside processing". If that process gets hung up, your action that tripped the trigger will wait until it completes.

You might want to read some of the articles on SQLTeam about sending email, such as Merkin's Sending SMTP Mail using a Stored Procedure and Building a Mail Queue System

Go to Top of Page
   

- Advertisement -