
The sp_who internal procedure allows users to view current activity on the database. This provides a view into several system tables (e.g., syslocks, sysprocesses, etc.).
Spid—The system process ID.
status—The status of the process.
loginame—Login name of the user.
hostname—Machine name of the user.
blk—If the process is getting blocked, this value is the SPID of the blocking process.
dbname—Name of database the process is using.
Cmd—The command currently being executed.
sp_who2 provides more details than this.
Following is another alternative way..
select spid,program_name,status,dbid,cmd
from master.dbo.sysprocesses
No comments:
Post a Comment