![]() |
---|
CREATE trigger TR_MAILPREFERENCE_INSERTUPDATE_EMAILVALID on dbo.MAILPREFERENCE after insert,update not for replication as begin if exists( select i.ID from INSERTED i inner join EMAILADDRESS e on e.ID=i.EMAILADDRESSID where e.DONOTEMAIL=1 ) begin ROLLBACK TRAN raiserror('Cannot save a mail preference that refers to an invalid email address.',13,1) end end |