我正在嘗試發送Sproc結果的電子郵件。我曾試着這樣做:將Sproc結果發送到SQL Server中的電子郵件
EXEC msdb.dbo.sp_send_dbmail
@recipients = '[email protected]',
@query = 'EXEC test_email' ,
@subject = 'Sample Data',
@attach_query_result_as_file = 1 ;
它給了我下面的錯誤:
Msg 15281, Level 16, State 1, Procedure sp_send_dbmail, Line 0
SQL Server blocked access to procedure 'dbo.sp_send_dbmail' of component 'Database Mail XPs' because this component is turned off as part of the security configuration for this server. A system administrator can enable the use of 'Database Mail XPs' by using sp_configure. For more information about enabling 'Database Mail XPs', see "Surface Area Configuration" in SQL Server Books Online.
是否有任何其他方式做到這一點?
我覺得這裏的錯誤信息實際上很有幫助。您是否嘗試與您的DBA檢查以啓用所需的SQL Server組件來發送電子郵件? – dcp