Quantcast
Channel: THWACK: Message List
Viewing all articles
Browse latest Browse all 20396

Re: Service Broker data not included

$
0
0

Here's what I'm using since we upgraded to 9:

AND s.spid LIKE '%'

union all

SELECT s1.loginame
,DB_NAME(s1.dbid) NAME
,s1.hostname
,s1.program_name
,isnull(r.sql_handle, s1.sql_handle) as sql_handle
,isnull(r.statement_start_offset, s1.stmt_start) as stmt_start
,isnull(r.statement_end_offset, s1.stmt_end) as stmt_end
,s1.spid
,CONVERT(SMALLINT, s1.waittype) waittype
,s1.lastwaittype
,s1.ecid
,s1.waittime
,CONVERT(VARCHAR(64), s1.context_info) context_info
,r.wait_resource
,s1.blocked
,r.plan_handle
,r.statement_start_offset
,r.statement_end_offset
,r.start_time
,r.query_plan_hash
FROM master..sysprocesses s1
LEFT OUTER JOIN sys.dm_exec_requests r ON r.session_id = s1.spid
WHERE s1.spid < 50
AND s1.STATUS != 'sleeping'
AND s1.cmd <> 'AWAITING COMMAND'
AND s1.lastwaittype NOT IN ('SLEEP_TASK')


Viewing all articles
Browse latest Browse all 20396

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>