Legacy View for SQL Server Process Monitoring
sys.sysprocesses is a legacy system view that shows details about current processes (similar to sessions) on the SQL Server. Although it’s still supported, it is considered deprecated in favor of the more modern sys.dm_exec_sessions and sys.dm_exec_requests views.
Key Columns:
- spid: The session ID or process ID.
- status: The status of the process (e.g., running, sleeping).
- dbid: The ID of the database the process is connected to.
- blocked: The ID of the process that is blocking this one (if any).
- cmd: The command being executed by the process.
- cpu: The CPU time used by the process.
- physical_io: The number of physical I/O operations performed by the process.
Use Case:
Even though it's deprecated, some DBAs still use sys.sysprocesses for backward compatibility with older SQL Server versions. It provides a mix of session and request information, similar to sys.dm_exec_sessions and sys.dm_exec_requests.
Example Query:
SELECT spid, status, dbid, blocked, cmd, cpu, physical_io FROM sys.sysprocesses;