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)
 sending email notifications to subscribers

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-04-08 : 12:00:53
Mikael writes "How do I create a trigger in SQL Server 7 that sends an email notification to each subscriber when a table is changed?

The Subscriber table is mainly a listing of E-mail addresses.
When the table they subscribe to is changed in any way (insert, delete, update) an email should be sent to each e-mail address in the subscriber table.

I found this code in the documentation:

CREATE TRIGGER reminder
ON titles
FOR INSERT, UPDATE, DELETE
AS
EXEC master..xp_sendmail 'MaryM',
'Don''t forget to print a report for the distributors.'
GO

It works, but it doesn't get several email addresses from a Subscriber table."
   

- Advertisement -