Execute .Net exe from sql job.

  • Hi All

    I have written an exe that will generate an excel report. I want to run this exe from sql server 2000. I scheduled a job for this. In the step for type i have specified as CmdExec and in the command i gave C:\psaudit\tool.exe and process exit code as 0.

    When i run the job it say successful but i think its not running the exe because the excel file is not generated. But when i double click the exe the excel file is getting generated.

    I will be very thanksfull to you if someone could help in resolving this problem.

    Thanks

    Rahul

  • I have resolved this issue. I gave the command \psaudit\tool.exe. instead of c:\psaudit\tool.exe

    WHen i removed c: it worked.

  • I observed that what was mentioned by me previously was wrong. The issue lies with exe file.

    When i execute the exe it picks the current path from where the exe runs and creates a xls file in the same location. The above mentioned job worked when I harded the path where the xls file needs to be generated.

    When sql server runs the exe it runs the application from C:\WINDOWS\system32 instead of running the application from current location C:\psaudit\ and what happens in the xls is getting generated in C:\WINDOWS\system32 instead of getting generated from C:\psaudit\

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply