Đang chuẩn bị liên kết để tải về tài liệu:
Microsoft SQL Server 2008 R2 Unleashed- P50
Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Microsoft SQL Server 2008 R2 Unleashed- P50:SQL Server 2005 provided a number of significant new features and enhancements over what was available in SQL Server 2000. This is not too surprising considering there was a five-year gap between these major releases.Microsoft SQL Server 2008 is not as much of a quantum leap forward from SQL Server 2005 | 434 CHAPTER 15 Database Mail If the test fails click Troubleshoot and SMSS opens the Troubleshooting Database Mail Books Online topic which provides a solid set of troubleshooting steps to get you started. If the mail is sent by SQL Server and successfully received in your client software s inbox you can proceed to the next section to learn how to use the sp_send_dbmail stored procedure to send email from T-SQL. Otherwise look for more troubleshooting help in the Related Views and Procedures section of this chapter. Sending and Receiving with Database Mail If you re building client applications that rely heavily on Database Mail it s crucial to gain an in-depth understanding of its underlying architecture. The following sections provide detailed information on its inner workings. The Service Broker Architecture As noted earlier SQL Server relies on Service Broker SSB to activate the Database Mail process DatabaseMail.exe used to send mail. DatabaseMail.exe uses ADO.NET to connect to SQL Server and to read from and write to SSB queues found in msdb that hold send requests and send statuses in the form of typed SSB messages. You can view these queues InternalMailQueue and ExternalMailQueue in the Object Browser by selecting Service Broker and then the Queues folder. If you look a bit further in the Object Browser you see how the mail transmission architecture is implemented in part as an SSB application as you find the corresponding internal and external Database Mail SSB services InternalMailService and ExternalMailService SSB message types SendMail and SendMailStatus and a single SSB contract SendMail v1.0 . SSB s involvement with Database Mail works like this 1. sp_send_dbmail as the SSB initiator is invoked and returns immediately. Under the covers this adds an SSB message of type SendMail to the SSB mail queue activating the undocumented internal stored procedure sp_ExternalMailQueueListener. Note that the mail message itself is saved to one or more of the msdb