一、查询版本:
二、SendMail


2 GO
3 sp_configure ' show advanced options ' , 1 ; GO RECONFIGURE ; GO sp_configure ' Database Mail XPs ' , 1 ; GO RECONFIGURE GO
4
5 exec msdb..sysmail_add_account_sp
6 @account_name = ' abc '
7 , @email_address = ' abc@XX.com '
8 , @display_name = null
9 , @replyto_address = null
10 , @description = null
11 , @mailserver_name = ' 10.91.50.40 '
12 , @mailserver_type = ' SMTP '
13 , @port = 25
14 , @use_default_credentials = 0
15 , @enable_ssl = 0
16 , @account_id = null
17
18 exec msdb..sysmail_add_profile_sp @profile_name = ' dba_profile '
19 , @description = ' dba mail profile '
20 , @profile_id = null
21
22 exec msdb..sysmail_add_profileaccount_sp @profile_name = ' dba_profile '
23 , @account_name = ' abc '
24 , @sequence_number = 1
25
26 -- - 示例:
27
28 exec msdb..sp_send_dbmail @profile_name = ' dba_profile '
29 , @recipients = '123 @XX.com '
30 , @subject = ' SQL Server 2008 Mail 测试 '
31 , @body = ' Hello Mail!测试 '
32 , @body_format = ' TEXT '
33
三、报表服务器的订阅WEB存档在Mail中显示BUG
表格在OutLook 2007 及以后的版本中显示瘦高,太丑,打过 SQL Server 2005 SP3 也能解决此问题。
四、SQL Server 2005 Reporting Server 订阅权限问题:
1、如果没有订阅管理权限,则:一个或多个邮件地址无效,无法自动识别邮件地址全名
<SendEmailToUserAlias>False</SendEmailToUserAlias>
取消使用别名,则可以手动输入Mail地址
2、有订阅权限则可能会意外删除别人的订阅
五、AdventureWorks、Northwind、pubs示例数据库下载
SQL Server 2005 / 2008 AdventureWorks 范例数据库下载:
http://www.codeplex.com/SqlServerSamples
默认情况下,Microsoft SQL Server 中不安装 Northwind 和 pubs 示例数据库。可以从此 Microsoft 网站下载上述数据库。
http://go.microsoft.com/fwlink/?LinkId=30196