Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Erland Sommarskog Newsgroups: microsoft.public.sqlserver.programming Subject: Re: SQL job never ending Date: Wed, 22 Apr 2020 21:07:54 +0200 Organization: Erland Sommarskog Lines: 23 Message-ID: References: <4c1094b8-f2d2-4462-ae8b-9dba4f415616@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Injection-Info: reader02.eternal-september.org; posting-host="82a515b6899e25f576b255fd6b7ed811"; logging-data="2735"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19kwJ7GS1eJp+R6rOCVmCpV" User-Agent: Xnews/2006.08.24 Mime-proxy/2.1.c.0 (Win32) Cancel-Lock: sha1:auqIowDfuLdTbsqcaFm/yojb66A= Xref: csiph.com microsoft.public.sqlserver.programming:31367 (sstiakakis@gmail.com) writes: > It looks like it has to do with the change in step 9. However, by making > changes to any other step, eg in 2 where I update a column of the table > ITEMTRANSACTIONS I changed the calculation method and yet the job never > stuck to step 2. > What could be the reason of this never-ending job? > All sorts of reasons: 1) Long-running query plan. 2) Infinite loop. 3) Blocking. There may be more, but those are the ones that come to mind immeidately.. Since I don't know your tables or your code, I can't say what it might be, but you could use my beta_lockinfo to investigate whether there is any blocking. It will also show you the current statement. Running it repeatedly, can also some indication of the progress. http://www.sommarskog.se/sqlutil/beta_lockinfo.html If the job is running a loop of some sort, you may also have help of Lee Tudor's sp_sqltrace, which is also on my web site: http://www.sommarskog.se/sqlutil/sqltrace.html