0

I had situation like this today- sorry that this is screenshot but it is easier way to show what i need to understand

enter image description here

As on screen - many processes was blocked by SPID 91

This SPID 91 querry was as on screen botom - procedure with name 'sprawdz_zlecenia_1'

But body of this procedure 'sprawdz_zlecenia_1' was /is like this now

select 0 as Liczba

Nohing more, so please let me known what am I missing here.

How this procedure that does not do any select even could create this block on server?

2
  • 3
    Check for open transactions, could be multiple statements in a transaction, you're only seeing the last one. Commented Nov 29, 2023 at 12:06
  • thanks i will check when next time will happen
    – Dorian
    Commented Nov 29, 2023 at 12:53

1 Answer 1

1

buttery

You'd probably find sp_WhoIsActive a better source of information that any of the built-in sp_who procedures.

Here's an example command that will order the output by which sessions have the most blocked sessions under them.

It will also add a column called additional_info to the output, which has XML details on which locked object blocked queries are waiting to access.

EXEC sp_WhoIsActive 
    @get_task_info = 2, 
    @get_additional_info = 1, 
    @find_block_leaders = 1, 
    @sort_order = '[blocked_session_count] DESC';

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.