SQL 2008 Job Agent running a C# Console Application

I have a C# console application that I need to run on a scheduled basis. The app also have a number of paramters (ie Start Date, End Date, 'Summary' or 'Detail') etc.

I can run the app from the cmd prompt no problem.

However, when I try to add this as a scheduled job, it fails.

First it gave me security issues, so I created a credential and proxy, but now it just hangs/runs without ending...

Can anyone confirm that console apps can run as SQL jobs?
If not, what options would you suggest?
If this should work, can anyone offer some suggestions on how to configure this?

I was trying to test so other apps, but they seem to have similar results.

Thanks in advance.
LVL 2
alkabelloAsked:
Who is Participating?
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
>Can anyone confirm that console apps can run as SQL jobs?
yes, that works in general

>If this should work, can anyone offer some suggestions on how to configure this?
usually this problem occurs because the sql agent service does not have the access to some resource used in the script.
so, what service is the sql agent service running under?
and what resources are accessed by the c# console app?
0
 
alkabelloAuthor Commented:
This seems very odd, but I set the SQL agent service back to using local Network Services, and the job runs (and the credentials and proxy seem to work).

if I set the service to use a user account that has access to both the network and SQL resources, I was getting an error message in the SQL job history that the credential user login failed...

So, after a bit of conflicting info, it seems to work.  I'm just not completely clear why.

Thanks
0
 
alkabelloAuthor Commented:
These questions helped to resolution the issue.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.