We have a stored procedure that we are trying to call with a SQL Server Agent Job. The stored procedure calls Database Mail. This is SQL 2008. The execute task is simply:
When the job runs, it is erroring out immediately, with the error:
Execute as user: NT AUTHORITY\NETWORK SERVICE. Error formatting query, probably invalid paramters [SQLSTATE 42000] (Error 22050). The step failed.
When we go into SQL Server Manager and just execute the SQL query, it works though. Something within the SQL Server Agent job, and Database Mail is causing problems. Any ideas? Thanks.
View Complete Post