sp_send_dbmail returns blank email while runs in a job step!

Respondido sp_send_dbmail returns blank email while runs in a job step!

  • Saturday, August 18, 2012 3:48 PM
     
     

    Hi, 

    I have a query and I want to be emailed in scheduled job.

    My query is worked fine. I put my query and the sp_send_dbmail with filled @body parameter into a Stored Procedure.

    Executing mentioned SP is error free and I can receive my email with full result of that query.

    But when I put this SP into a job, it sends only a blank email!

    I am sure the cause of this problem is related to the SQL Server Agent service user. My SQL Server Agent is set to NT AUTHORITY\SYSTEM and if I change it to Domain\administrator the result email will be full and correct but for other related services and mirroring I can't change it for ever.

    I also test it with "run as " parameter and I put in the bigger hole with new errors and security alerts...

    Can you guide me about the further security needs for NT AUTHORITY\SYSTEM as SQL Server Agent user? (Its current role is set to sysadmin)

All Replies