SQL SERVER 2005 – How to get processes of database

To get all the processes of the database. 

select spid, status, blocked, open_tran, waitresource, waittype, waittime, cmd, lastwaittype, cpu, physical_io,

memusage, last_batch=convert(varchar(26), last_batch,121),

login_time=convert(varchar(26), login_time,121),net_address,

net_library, dbid, ecid, kpid, hostname, hostprocess,

loginame, program_name, nt_domain, nt_username, uid, sid,

sql_handle, stmt_start, stmt_end

from master.dbo.sysprocesses

where blocked!=0 or waittype != 0x0000

 result

Advertisements

2 thoughts on “SQL SERVER 2005 – How to get processes of database

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