Gabrielle_Missouri
New Member
I would like to send an e-mail alert after inserting a new data to my sql server data table. How can i do this?I have tried following trigger, but i'm no pretty sure about the functionality of it. \[code\]CREATE TRIGGER dbo.sendMail ON dbo.staff_leaves AFTER INSERTAS BEGIN SET NOCOUNT ON; EXEC msdb.dbo.sp_send_dbmail @to = '[email protected]', @profile_name = 'default', @subject = 'New Row', @body = 'Yep, they sure were.';ENDGO\[/code\]Anyone please explain me how to do this.