You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'Query in ' + DB_NAME(db.resource_database_id) + ' has been running since ' + CAST(r.start_time AS NVARCHAR(100)) + '. ' + @LineFeed + @LineFeed
774
-
+ CAST(COALESCE((SELECT TOP 1 [text] FROM sys.dm_exec_sql_text(rBlocker.sql_handle)),
772
+
'Query in '+COALESCE(DB_NAME(COALESCE((SELECTTOP1dbidFROMsys.dm_exec_sql_text(r.sql_handle)),
773
+
(SELECTTOP1t.dbidFROMmaster..sysprocesses spBlocker CROSSAPPLYsys.dm_exec_sql_text(spBlocker.sql_handle) t WHEREspBlocker.spid=tBlocked.blocking_session_id))), '(Unknown)') +' has a last request start time of '+CAST(s.last_request_start_timeASNVARCHAR(100)) +'. Query follows:'+ @LineFeed + @LineFeed
AND request_owner_type = N'SHARED_TRANSACTION_WORKSPACE') AS db ON s.session_id = db.request_session_id
799
-
LEFT OUTER JOIN sys.dm_exec_requests rBlocker ON tBlocked.blocking_session_id = rBlocker.session_id
800
-
WHERE NOT EXISTS (SELECT * FROM sys.dm_os_waiting_tasks tBlocker WHERE tBlocker.session_id = tBlocked.blocking_session_id AND tBlocker.blocking_session_id IS NOT NULL)
801
-
AND s.last_request_start_time < DATEADD(SECOND, -30, SYSDATETIMEOFFSET())
0 commit comments