• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 414
  • Last Modified:

Trigger to send email - t-sql

Hello,
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?
thanks
0
Nyana22
Asked:
Nyana22
  • 2
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
>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.
0
 
Nyana22Author Commented:
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?
thanks
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
setting up & sending mail via dbmail:
www.databasejournal.com/features/mssql/article.php/3626056 
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now