
October 7th, 2004, 03:03 PM
|
|
Registered User
|
|
Join Date: Oct 2004
Posts: 1
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
osql command
All:
I'm trying to run a SQL job via 3rd party scheduling software. (CA Workload Manager) I can start the job by executing osql -E -Q"exec msdb.dbo.sp_start_job 'jobname' " from the command line, but the command exit as soon as the SqlServerAgent start the job, which in turn kills the connection back to the scheduling software while the job continues to run in the background. If I use osql with the -q flag the connection never closes.
I need away to execute a sql job via the command line that holds the connection throughout the duration of the jobs execution and passes back a return code other then 0 on failures. Does anyone have any suggestion on how to a execute a sql job from the command line that operates synchronously?
Thanks
|