Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
wided
Posting Yak Master
218 Posts |
Posted - 2014-02-11 : 06:03:34
|
are there a SQL2012 code to send an email by trigger or stored procedurethanks |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2014-02-11 : 20:33:52
|
setup http://technet.microsoft.com/en-us/library/ms175887%28v=sql.105%29.aspxand you can send email using http://technet.microsoft.com/en-us/library/ms190307%28v=sql.105%29.aspx KH[spoiler]Time is always against us[/spoiler] |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2014-02-12 : 00:00:20
|
you can use sp_send_dbmailWhy do you want to do it from trigger? Can you tell your exact requirement?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
wided
Posting Yak Master
218 Posts |
Posted - 2014-02-18 : 05:20:27
|
validation of a document, I need to send a notification to one or more persons |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2014-02-18 : 13:09:18
|
why use trigger for validation? why not write rules inside a procedure?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
wided
Posting Yak Master
218 Posts |
Posted - 2014-02-20 : 08:32:36
|
Yes I can also use a procedure can you tell me how? |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2014-02-23 : 10:28:52
|
quote: Originally posted by wided Yes I can also use a procedure can you tell me how?
I cant without knowing any of your rules!the stub will look like belowCREATE PROC ValidateBusinessRules@param1 ...AS..GO ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
sz1
Aged Yak Warrior
555 Posts |
Posted - 2014-02-25 : 08:46:50
|
Try this! IF OBJECT_ID('sd_Trigger', 'TR') IS Not Null Drop Trigger sd_Trigger GO Create Trigger sd_Trigger On dbo.Test After Update, Insert, Delete AS exec msdb.dbo.sp_send_dbmail @profile_name = 'profile name goes here', @recipients = 'someemailaddress@domain.co.uk', @body = 'hello world', @subject = 'test email'; GOSZ1Please help me to enable me to help others! |
|
|
|
|
|