Reputation: 733
I am into a Winforms application using C# and Visual Studio 2010 along with SQL Server Management Studio 2008 R2.
My application checks the previous values in the database and if the current value being inserted falls under a certain range, I need to execute a method written in C# i.e. the host language. The method actually sends E-mails to the e-mail addresses stored in the database.
Now the checking part can be easily done using a trigger but the latter is troublesome for me.
Can anyone please help me out?
Upvotes: 2
Views: 2193
Reputation: 239636
You might want to look into Database Mail. This integrates email sending functionality within SQL Server.
Otherwise, I'd strongly suggest not trying to do this directly within the trigger - sending an email could be a time consuming process, and you wouldn't want to delay the completion of the transaction if the email functionality isn't currently working.
Upvotes: 2
Reputation: 56769
There are a couple of ways to handle this.
Upvotes: 3