Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
CREATE table #tmpUsers(
spid int,
STATUS varchar(50),
loginname varchar(50),
hostname varchar(50),
blk varchar(10),
dbname varchar(50),
cmd varchar(30),
CPUTIME varchar(255),
DISKIO varchar(255),
LASTBATCH Varchar(30),
ProgramName Varchar(255),
SPID2 int,
requestid int)
INSERT INTO #tmpUsers EXEC SP_WHO2
SELECT * FROM #tmpUsers
DROP TABLE #tmpUsers
declare @handle binary(20)
select @handle = sql_handle
from master.dbo.sysprocesses where spid = [b]YOUR SPID HERE[/b]
select * from ::fn_get_sql(@handle)
EXEC msdb.dbo.sp_send_dbmail
Any active process can become suspended for any number of reasons. Most common is it is being blocked.How would sql server know to list a job as suspended based on time if there's no real error?
This part is not easy because the ProgramName will show up as SQLAgent. I've always had to use profiler for that step.How do I get a job name from the spid or some other field in these tables?
Wait type is a field in sysprocesses that tells you the reason you spid has been suspended.what is wait type? The definition is simply "reserved"
I always compare to the last run time.When you say you use 100%... what are you comparing?