我正在尝试sp_send_dbmail
通过 SQL Server 2014 中的 SQLAgent 作业发送查询结果。我相信我的 DBMail 配置文件设置正确,但是在运行时:
exec msdb.dbo.sp_send_dbmail
@profile = 'TestProfile',
@recipients = 'testmail@gmail.com',
@subject = 'Test',
@query = 'SELECT id FROM TestTable',
@attach_query_result_as_file = 1,
@query_attachment_filename = 'TestValues.txt'
我收到以下错误消息:
Failed to initialize sqlcmd library with error number -2147467259.
谷歌搜索此错误消息并没有发现任何有用的信息,可能是由于通用错误号。有人对此错误消息有一些了解吗?