Hello,
I have a script which basically reports some info about sql servers daily via email. The Database Mail is correctly setup. SQL2k16 enterprise edition. When I run the script inside Query window (interactive), it works fine and do I do
get the email. However, when I run the script inside a SQL server agent job, I see following error in the sql server agent job history:
Executed as user: mydomain\ADsqlserverserviceaccount. Failed to initialize sqlcmd library with error number -2147467259. [SQLSTATE 42000] (Error 22050). The step failed.
Will really appreciate your help on fixing this.
Thanks.
Victor
Victor