Trigger to send email - t-sql

Posted on 2008-11-05
Last Modified: 2008-11-12
i have one DB on a sql server, (express),
the DB has one stored procedure, how can i write a trigger to send email each time the procedure runs??
is there any settings or requirement other to the trigger syntax?
Question by:Nyana22
    LVL 142

    Expert Comment

    by:Guy Hengel [angelIII / a3]
    >how can i write a trigger to send email each time the procedure runs??
    you cannot have a trigger on "run" of a procedure. you should include the "send email" code in the procedure itself.

    Author Comment

    ok, thanks, i will add the code at the end of the procedure,
    but i don't know this code, could you tell me a sample, or point me to an article, please?
    LVL 142

    Accepted Solution

    setting up & sending mail via dbmail:

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    If you having speed problem in loading SQL Server Management Studio, try to uncheck these options in your internet browser (IE -> Internet Options / Advanced / Security):    . Check for publisher's certificate revocation    . Check for server ce…
    There are some very powerful Data Management Views (DMV's) introduced with SQL 2005. The two in particular that we are going to discuss are sys.dm_db_index_usage_stats and sys.dm_db_index_operational_stats.   Recently, I was involved in a discu…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now