2013-01-03 53 views
0
I have the checkbox in the front end called "Ticket". If Ticket checkbox is clicked then an email will be sent to the reciepents. 

Here I know who are the reciepients, so that is not the problem. Also email body is ready. 

Only, I want the condition in the query when the ticket check box is clikced that email should be sent. There is also the hasticket bit field in table which I am using. So initially, this hasticket field will be 0. How I can achieve this? 

This is the sample data: 

Pass NO. hasticket name 
A1234  0   abc 

當我單擊前端的複選框時,應將電子郵件發送到abc。單擊複選框後發送電子郵件

這裏我有:存儲proc sppass_update,它將更新表中的hasticket字段。所以首先我需要使用這個存儲過程來更新表。然後我可以發送電子郵件。我怎樣才能acheve此SQL Server

+0

你的「前端」是什麼?這是一個.Net應用程序嗎? – 2013-01-03 07:30:02

+0

是的,這是.net應用程序 – user1599392

+0

那麼,你問如何在SQL Server或你的.Net應用程序中觸發這個事件? – 2013-01-03 19:34:36

回答

1

使用數據庫郵件組件:發送電子郵件

  1. 配置配置文件,如使用SSMS嚮導。
  2. 撥打sp_send_dbmail系統步驟,使用您的參數使用您的配置文件發送電子郵件。

SQL Server將發送電子郵件。