Have SQL Agent jobs that have literally ran for years but are now occasionally failing with the error of: "Error formatting query, probably invalid parameters".
I've checked all permissions and the query itself and they all seem to be okay. The reason I say this is because if I continually try running the job, I'll get some times that it goes through fine and sends the email attachment and others to where it fails with the error above. It leads me to believe that there is some other process going on somewhere that causes this issue, but when the job runs it doesn't know about it, fails and then gives me that generic error.
I've tried putting in an xp_stopmail, xp_startmail at different spots in the stored proc, but no luck there.
Can you guys give me some things that would cause this intermittent failure?