Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

CmdExec problem Expand / Collapse
Author
Message
Posted Wednesday, January 02, 2013 9:13 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, January 02, 2013 3:13 PM
Points: 11, Visits: 42
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.
Post #1401905
Posted Wednesday, January 02, 2013 9:21 AM


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: Monday, April 14, 2014 1:34 PM
Points: 15,442, Visits: 9,588
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
Post #1401910
Posted Wednesday, January 02, 2013 12:20 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, January 02, 2013 3:13 PM
Points: 11, Visits: 42
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
Post #1402033
Posted Thursday, January 03, 2013 2:37 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Wednesday, April 16, 2014 9:25 AM
Points: 7,070, Visits: 12,523
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

Believe you can and you're halfway there. --Theodore Roosevelt

Everything Should Be Made as Simple as Possible, But Not Simpler --Albert Einstein

The significant problems we face cannot be solved at the same level of thinking we were at when we created them. --Albert Einstein

1 apple is not exactly 1/8 of 8 apples. Because there are no absolutely identical apples. --Giordy
Post #1402575
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse