SQL Server: Processes and Statistics commands

I frequently forget these.

sp_who2 shows you the processes that are currently running. Using sp_who2.

(Code for a better sp_who2 sproc: http://sqlserverplanet.com/dmv-queries/a-better-sp_who2-using-dmvs-sp_who3/)

 

Shows you the last statement sent from a client:

 

Kill process:

Show IO statistics for query:

SET STATISTICS TIME ON

 

Show how long parse, compilation, and execution of a query takes: