if i kill spid on long query running inside daily job will cancel all job ?

ahmed salah 3,216 Reputation points
2021-12-15T23:53:32.577+00:00

i work on sql server 2014 suppose i running daily job

and this daily job having more sql server query running

if one query running take too long time
and i need to kill it
it will cancel all job
or will cancel current query running then resume
if possible quickly answer

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,233 questions
Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,515 questions
{count} votes

2 answers

Sort by: Most helpful
  1. CathyJi-MSFT 21,106 Reputation points Microsoft Vendor
    2021-12-16T01:03:20.393+00:00

    Hi @ahmed salah ,

    If this query step in the daily job is set as below screenshot, the job will continue to work. This will not affect other steps running in this job.

    157980-screenshot-2021-12-16-090228.jpg


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    0 comments No comments

  2. Erland Sommarskog 98,751 Reputation points
    2021-12-16T23:05:48.403+00:00

    It depends on what type of job step you have. It if it is a T-SQL job step, that step will completed, and if the job is set up the normal way, the job will end as failed. But as Cathy shows above, a job step may be set up so that it continues on the next in case of failure.

    If the job step is of any other kind, it depends on how the program/package/whatever that runs the query is written. One would expect that it stops, but that is all up to the programmer.

    0 comments No comments