Your question, your audience. Choose who sees your identity—and your question—with question security.
ALTER TRIGGER [scheme].[email_insert] ON [scheme].[opdetm] AFTER INSERT AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; EXEC msdb.dbo.sp_send_dbmail @profile_name = '1', @recipients = 'email@example.com', @subject = 'subject', @body = 'body', @query = 'SELECT order_no FROM INSERTED with (NOLOCK)', @execute_query_database = 'demo' END
Join the community of 500,000 technology professionals and ask your questions.