amachanic / sp_whoisactive

sp_whoisactive
GNU General Public License v3.0
1.13k stars 281 forks source link

'Dormant' should be treated the same as 'sleeping' #110

Open JC-aus opened 9 months ago

JC-aus commented 9 months ago

The show_sleeping_spids flag is intended to show connections that are not performing any sql activity or holding any resources. 'Dormant' is the same as "sleeping", except a "DORMANT" SPID was reset after completing an RPC event from remote system (possibly a linked server). This cleans up resources and is normal; the SPID is available to execute.

                     CASE @show_sleeping_spids
                           WHEN 0 THEN
                                'AND not sp0.status in (''sleeping'',''dormant'')
                                '
                            WHEN 1 THEN
                                'AND
                                (
                                    not sp0.status in (''sleeping'',''dormant'')
                                    OR sp0.open_tran_count > 0
                                )
                                '
                            ELSE
                                ''
                        END +