Click here to Skip to main content
15,919,422 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello everyone,

Does anybody have a good idea how to set up e-mail notifications when a new record is created i my Sql Server Database. I would like to be able to e-mail a notification to the responsible salesrep. when a salesorder is created within his responsibility area. So i also need to have a some rules setup for creterias for sending emails.

I have an sql database i Azure and i don't have access to any SqlAgent from there?

What I have tried:

I have not tried anything yet but hoping to get a good idea how to solve it.
Posted
Updated 1-Apr-16 7:15am
Comments
ZurdoDev 1-Apr-16 12:52pm    
Don't do it from the sql side, do it from your code side.
Kristian_dk 1-Apr-16 13:28pm    
Thanks for helping out RyanDev. Any specific reasons for not doing it from the sql server side?
ZurdoDev 1-Apr-16 13:39pm    
Because you have limited access to sql. In code you can do anything. And SQL is a database, not the best place to be doing business logic like emails, even though it can.

1 solution

you can user triggers to send a email notifications whenever a table gets inserted/updated/deleted.


refer this link:
sql server 2008 r2 - Send e-mail from a trigger - Stack Overflow[^]
 
Share this answer
 
Comments
Kristian_dk 1-Apr-16 13:29pm    
Thanks for helping me. I'll try this tomorrow. ;-)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900