cancel
Showing results for 
Search instead for 
Did you mean: 

Cancel running job

Private_Member_19084
Active Contributor
0 Kudos


Hi experts,

I've scheduled a job which is running to long and I want to cancel now.

The scheduling I have done via DBACOCKPIT, as there is no option to cancel in, I guess I have to do that in isql.

However, what is the command for that?

Kind regards

Accepted Solutions (1)

Accepted Solutions (1)

Johan_sapbasis
Active Contributor
0 Kudos

Hi Martin,

Do you know the job name?

SyBooks Online

Can you see the job running with sp_who perhaps? it should run under sapsa user.

Kind Regards,

Johan

Private_Member_19084
Active Contributor
0 Kudos

Got the jobname and ID in dabacockpit.

I found out now, cancel with

exec sybmgmtdb..sp_sjobcontrol @name="<job id> ", @option="terminate"

but, why is it sometimes a SP with exec at the beginning and sometimes not?

Johan_sapbasis
Active Contributor
0 Kudos

Hi Christian,

That would be because the .sp_sjobcontrol you were running is existing in database sybmgmtdb.

So as per your command you are actually saying:

execute sybmgmtdb and within this database run stored procedure called sp_sjobcontrol

This my understanding.

Johan

Private_Member_19084
Active Contributor
0 Kudos

makes absolutly sense, as I leanred today that this is the DB which is including the jobs

former_member188958
Active Contributor
0 Kudos

In ASE TSQL, the EXEC(ute) keyword is optional when a stored procedure call is the only statement in a batch.

-bret


Private_Member_19084
Active Contributor
0 Kudos

got you, thx for that

Answers (1)

Answers (1)

Private_Member_19084
Active Contributor
0 Kudos

I have already found sp_sjobcontrol, however, "stored procedure is not found".

Kind regards