How to measure CPU pressure in SQL Server and tell whether your server needs a faster CPU or more CPUs, using simple scripts and signs.
SQL SERVER – Get Last Running Query Based on SPID
How to see the last running query of another session based on its SPID, using @@SPID to find session IDs and DBCC INPUTBUFFER to read the query.
SQL SERVER – Performance Counters from System Views – By Kevin Mckenna
SQL and .NET expert Kevin Mckenna, whom I met on Twitter, shows how to read SQL Server performance counters from system views.
SQL SERVER – List All Objects Created on All Filegroups in Database
A reader asked which object belongs to which filegroup. Here is how to list all objects created on all filegroups in a database, with a sample database.
Reading System Procedures With OBJECT_DEFINITION
Use OBJECT_DEFINITION and sys.system_sql_modules to read visible SQL Server system procedure text and learn how built-in tools work.
SQL SERVER – List All the Tables for All Databases Using System Tables
A one line script with sp_msforeachdb and sys.tables to list all the tables for all databases on a server, updated with ideas from reader comments.
SQL SERVER – Interesting Observation of DMV of Active Transactions and DMV of Current Transactions
sys.dm_tran_active_transactions and sys.dm_tran_current_transaction look alike, but one lists active transactions for the instance, the other only your session.






