Administering SQL Server

Monitoring with Transact-SQL Statements

Microsoft® SQL Server™ provides several Transact-SQL statements and system stored procedures that allow ad hoc monitoring of an instance of SQL Server. Use these statements when you want to gather, at a glance, information about server performance and activity. For example:

Most of this information can also be monitored using SQL Server Enterprise Manager, SQL-DMO, or System Monitor (Performance Monitor in Microsoft Windows NT® 4.0).

To view the current locks

Transact-SQL

Enterprise Manager

Enterprise Manager

SQL-DMO

To view the current server activity

Transact-SQL

Enterprise Manager

Enterprise Manager

SQL-DMO

To view the last command batch for a connection

Transact-SQL

Enterprise Manager

Enterprise Manager

SQL-DMO

To view the data space information for a database

Transact-SQL

Enterprise Manager

Enterprise Manager

SQL-DMO

To view the log space information for a database

Transact-SQL

Enterprise Manager

Enterprise Manager

SQL-DMO

To view the oldest active transaction in the database

Transact-SQL

To view performance information

Transact-SQL

To view procedure cache usage

Transact-SQL

To view general statistics about SQL Server activity and usage

Transact-SQL

See Also

Monitoring with SQL Server Enterprise Manager

Monitoring with System Monitor

TML>