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)
 triggers!

Author  Topic 

maximus007
Starting Member

18 Posts

Posted - 2004-08-16 : 14:45:31
I am new to sql and I need some assistance on e-mail. I have the following trigger set up as the following. What I would like to do is for each area that is recognize or predefine. I would like the system to send an e-mail. Can someone show me how that can be achieve? here's what I have so far.

CREATE TRIGGER test ON dbo.Escalation_Forms
FOR INSERT, UPDATE, DELETE
AS

Update
Escalation_Forms
Set
Entity =
Case When Left(Right(Account_Number,12),2) = '60' Then 'Dade_Broward'
When Left(Right(Account_Number,12),2) = '61' Then 'Sourth_Dade'
When Left(Right(Account_Number,12),2) = '62' Then 'Metro_Miami'
When Left(Right(Account_Number,12),2) = '63' Then 'Margate'
When Left(Right(Account_Number,12),2) = '64' Then 'Keys'
When Left(Right(Account_Number,12),2) = '65' Then 'Treasure_Coast'
When Left(Right(Account_Number,12),2) = '75' Then 'Broward'
Else 'TROUBLE'
End

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-08-16 : 15:02:16
How are you sending an e-mail? Do you have SQL Mail configured? The UPDATE statement would be part of the application, then the trigger would do the e-mail.

Tara
Go to Top of Page
   

- Advertisement -