SQL Query to get the running process details

Hi,
I came across this vital SQL Query to find all the process details running on a instance showing the Most CPU consumed process at first.Thought might help.
USE MASTER
GO
SELECT SPID, SP.DBID, DB_NAME(SP.DBID) AS DBNAME,
TEXT,CPU,HOSTNAME,LOGIN_TIME,LOGINAME,STATUS,PROGRAM_NAME,NT_DOMAIN, NT_USERNAME
FROM SYSPROCESSES SP CROSS APPLY SYS.DM_EXEC_SQL_TEXT(SQL_HANDLE)
ORDER BY CPU DESC
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s