Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

SQL or other to identify sqlserver top cpu processes

4 posts in Windows NT Last posting was on 2001-05-11 00:22:07.0Z
Geoff_Smith Posted on 2001-05-08 05:37:03.0Z
From: Geoff_Smith
Date: Tue, 8 May 2001 01:37:03 -0400
Newsgroups: sybase.public.sqlserver.nt
Subject: SQL or other to identify sqlserver top cpu processes
Message-ID: <8AC2296CDECD359A001EDBDB85256A46.001EDBEA85256A46@webforums>
Lines: 8
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub sybase.public.sqlserver.nt:786
Article PK: 1087393

Hi folks,

Would anyone have at their fingertips an sql or NT script to identify the
processes that are utilising the most resources in sqlserver (esp cpu)

Cheers,

Geoff


Geoff_Smith Posted on 2001-05-09 02:05:14.0Z
From: Geoff_Smith
Date: Tue, 8 May 2001 22:05:14 -0400
Newsgroups: sybase.public.sqlserver.nt
Subject: Re: SQL or other to identify sqlserver top cpu processes
Message-ID: <8D6EF05C7D5CBE5D000B775585256A47.00231E5085256A46@webforums>
References: <8AC2296CDECD359A001EDBDB85256A46.001EDBEA85256A46@webforums>
Lines: 5
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub sybase.public.sqlserver.nt:776
Article PK: 1087383

Yeh, I found sp__whotokill, seems OK

any others

Geoff


Scott Posted on 2001-05-10 13:50:44.0Z
From: Scott
Date: Thu, 10 May 2001 09:50:44 -0400
Newsgroups: sybase.public.sqlserver.nt
Subject: Re: SQL or other to identify sqlserver top cpu processes
Message-ID: <63A6CF1DF898824D004C0E7585256A48.000EE23685256A47@webforums>
References: <8AC2296CDECD359A001EDBDB85256A46.001EDBEA85256A46@webforums> <8D6EF05C7D5CBE5D000B775585256A47.00231E5085256A46@webforums>
Lines: 3
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub sybase.public.sqlserver.nt:759
Article PK: 1087365

Could you post the sp__whotokill syntax?

Thanks


Geoff_Smith Posted on 2001-05-11 00:22:07.0Z
From: Geoff_Smith
Date: Thu, 10 May 2001 20:22:07 -0400
Newsgroups: sybase.public.sqlserver.nt
Subject: Re: SQL or other to identify sqlserver top cpu processes
Message-ID: <C5F03B8F4A4A0D460002068485256A49.005012D685256A48@webforums>
References: <8AC2296CDECD359A001EDBDB85256A46.001EDBEA85256A46@webforums> <8D6EF05C7D5CBE5D000B775585256A47.00231E5085256A46@webforums> <63A6CF1DF898824D004C0E7585256A48.000EE23685256A47@webforums>
Lines: 25
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub sybase.public.sqlserver.nt:755
Article PK: 1087362

Certainly,


create proc sp__whotokill ( @delay varchar(8) = "00:00:30" )
as
begin
select spid, suid, cpu into #start from master..sysprocesses

waitfor delay @delay

select spid, suid, cpu into #finish from master..sysprocesses

select f.spid, suser_name(f.suid), f.cpu - s.cpu
from #start s,
#finish f
where f.spid = s.spid
and f.suid = s.suid
and suser_name(f.suid) is not null
order by f.cpu - s.cpu DESC
end


cheers,

Geoff