SQL Server stored procedures and commands

The items in this section can be used to return information related to performance.
Note: This topic applies only to on-premises environments.
  • sp_who and sp_who2 - The stored procedure sp_who shows what SPID is blocked. sp_who2 shows who is blocking.
  • sp_helpindex (table_name) - Gives index information on a table.
  • DBCC OPENTRAN - Determines whether an open transaction exists within the log.
  • DBCC INPUTBUFFER (SPID) - Displays the last statement sent from a client to SQL Server.
  • DBCC Trace On - Enables specified trace flags.