CmdExec problem

  • I have a job that has 4 steps. The first step runs the SSIS pkg. The second step calls a program after completing step one. I use the Operating System (CmdExec) in the step to call the program and run as a SQL Server Agent Service Account. Then the path to the .exe is in the command section. c:\MyProgramFile\MyProgram.exe with the process exit code as 0. I am not sure the program is running when it is called because the job immediately goes to the next step which is another program which does not appear to run either (the second program is set up the same way in its step). The job's next step is an SSIS pkg which runs fine.

    My question. How do I make sure step 2 runs before the job goes to step 3? And how do I make sure it is running at all. The history log says it completed but I do not see the document should create.

  • Can you set up a Hello World app and run that as a test? Something simple that just writes a line to a text file or something like that? Then run that in the step to see what's going on a bit more indirectly.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • It runs using PowerShell but when I try to use the PowerShell that is in Sql Server Agent, it does not run. does anyone know what scipt I should use in PowerShell to run this .exe program? This is what I have: C:\myfile\myprogram.exe

  • The PowerShell step type runs commands in a mini-shell called sqlps.exe which is not the same as what you get when you open a PowerShell prompt using powershell.exe so results may vary.

    You said your program runs at a PowerShell prompt (powershell.exe). Have you tried running it at a standard CmdShell prompt (cmd.exe)?

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

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

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