我有一封电子邮件失败,函数返回值为“101”,@@error 值为“0”(未添加任何行sysmail_allitems
)。
我在哪里可以找到有关此函数的返回代码的文档?
显示我如何获得上述值的示例代码:
exec @result = msdb.dbo.sp_send_dbmail
@profile_name = 'OBFUSCATED',
@recipients = @DL,
@subject = 'OBFUSCATED',
@body = @emailBody,
@body_format='html',
@query = @reportQuery,
@exclude_query_output = 1,
@attach_query_result_as_file = 1,
@query_attachment_filename = @filename,
@query_result_separator = @temp,
@query_result_header = 1,
@mailitem_id = @mailitem_id
;
set @temp = @@ERROR;