SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


CmdExec problem


CmdExec problem

Author
Message
maximost1
maximost1
SSC Rookie
SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)

Group: General Forum Members
Points: 33 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.
GSquared
GSquared
SSC-Insane
SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)

Group: General Forum Members
Points: 23283 Visits: 9730
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
maximost1
maximost1
SSC Rookie
SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)

Group: General Forum Members
Points: 33 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
Orlando Colamatteo
Orlando Colamatteo
SSChampion
SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)

Group: General Forum Members
Points: 14825 Visits: 14396
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
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search