For the past hour I’ve been racking my brain trying to figure out why SQL Agent kept throwing an error whenever I ran a job using CMDExec. The job ran a very simple C# Console application.
Date 2/27/2012 11:57:14 AM
Log Job History (TEST JOB NAME)
Step ID 1
Job Name Active Directory Empnum Update
Step Name Call Executable
Sql Severity 0
Sql Message ID 0
Operator Net sent
Retries Attempted 0
Executed as user: USERNAME REMOVED. The step did not generate any output. Process Exit Code -2146232576. The step failed.
The problem was that I compiled the application using a .Net Framework that we don’t have on our database server. To fix this go to your project’s properties and change the target framework to something that is installed on your DB server.
This is a very rookie mistake so hopefully this will save you a few minutes when you do the same dumb thing.