This query runs for almost an entire week
Hi everyone. I am trying to figure out why this query SPID stays open for the entire duration of a batch job. The batches usually take a week to complete and during that time, this SPID is open the entire time.
I have run the query myself and while it is large and returns 4.5 million rows, it completed in about 4 minutes.
What could be causing the query to stay open, locking resources, for the duration of the weekly batch?
Thanks for reading.
What consumes the rows produced by this query? If the rows are gradually consumed over the course of the run, that would keep the query "open".