var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: SP or trigger for email of new record insert to table
Does anyone have a stored procedure for sending an email (using SQLMail) when a new record is added to a database table?
I have SQLMail all setup, I just need a good example of a stored procedure or trigger that will sending an email with the details for a new record entry into a table.
Does depend on what you want to say but here a start.
CREATE TRIGGER [NewRowsAdded] ON [dbo].[tablename]
@recipients = 'firstname.lastname@example.org',
@subject = 'New Rows Added',
@message = 'Hey theres some new rows? Take a peek!'
Thank you for the reply!
I have our Help Desk database setup in SQL Server 2K. Basically, I would like to send an email to the user (field name: userid, which also works for their email) and a copy to our main distribution address - email@example.com.
Each record that is added should generate this email and send to the parties listed above.
thanks again for your help!
So do you want to inlcude details of the row or just email the addresses (in which case add as many email address as you like name@bla;name@bla
I would like to add the field information as well. So I have the following as fields that I would like to include in the email: