If there have process runs longer time or stuck, in below to check is the query lock by another query :
1. Check from database use session query :
|
2. In below is sample case occurred when Run process DJ stuck :
After checking on the database side by running a query on number 1, there is a UPDATE STATISTICS query dbo.DB_QUEUE PK_DB_QUEUE with a suspended status
3. Then continue checking by running the query sp_who2 "SPID number" in this sample we use SPID = 164, there is a value in the BlkBy field that is 58, which means the query is blocked by a query with SPID 58.
4. Then kill the query which has SPID 58 which makes the query suspended, with query below:
kill 58
5. Check the query whether the query still suspend or not.