Category: Performance Tuning
-
DBA Scripts: Create Login Activity Session
🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Performance & Troubleshooting › Extended Events & Tracing “Who actually connects to this server?” is a question you can’t answer from documentation. Not who’s supposed to connect, who is. Ownership changes, connection strings get copied into three other applications nobody told you about,…
Written by
-
DBA Scripts: Get Schema Change History
🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Server & Configuration “What Changed on This Server Recently?” That question comes up after almost every unexpected behavior change: a query that used to work now errors, a report that used to return data now doesn’t, a job that used to succeed now…
Written by
-
DBA Scripts: Get Active Connections by Database
🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Performance & Troubleshooting The Check Before You Take Anything Offline Taking a database offline, whether for a decommission, a restore, or a maintenance operation that needs exclusive access, starts with the same question: is anyone actually using it right now? Guessing wrong means…
Written by
-
DBA Scripts: Get Query Store Regressions and Forced Plans
🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Performance & Troubleshooting › Query & Performance Tuning “What Changed Today” and “Is the Plan I Forced Still Any Good” Query Store Top Queries tells you what’s expensive right now. This post covers two narrower, sharper questions that come up once Query Store…
Written by
-
DBA Scripts: Get Extended Events Sessions
🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Performance & Troubleshooting › Extended Events & Tracing What’s Actually Running on a Server You Just Inherited Extended Events sessions are easy to lose track of. Someone sets one up to chase a specific problem, the problem gets fixed, and the session keeps…
Written by
-
DBA Scripts: Get Index Usage Stats
🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Maintenance & Automation › Index Maintenance The Raw Usage Data Behind Every Index Decision Unused Indexes already filters straight to drop candidates in one database. This script is the raw data underneath that filter, and more: every index across every user database, its…
Written by
-
DBA Scripts: Get Query Performance Deep-Dive
🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Performance & Troubleshooting › Query & Performance Tuning Four Angles on “Why Is This Slow” That Go Beyond Top CPU Top CPU Queries ranks by raw resource consumption. These four scripts answer more specific questions the ranking alone can’t: Get-StoredProcedurePerformance ranks stored procedures…
Written by
-
DBA Scripts: Get Active Sessions and Requests
🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Performance & Troubleshooting Who’s Connected, and What’s Actually Running Right Now Worker Threads and Active Sessions gives you the aggregate health number: how close the worker thread pool is to exhaustion. These three scripts give you the per-session detail underneath that number. Get-ActiveSessions…
Written by
-
DBA Scripts: Get Top CPU Queries
🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Performance & Troubleshooting › Query & Performance Tuning Three Different Ways a Query Can Be the Problem “Which query is causing this” has more than one right answer, because a query can be expensive in different ways: it can burn CPU, it can…
Written by
-
DBA Scripts: Query and Performance Tuning
🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Performance & Troubleshooting “The database is slow” almost never means the whole database, it means one query, one plan, one statistic that went stale at the wrong moment. Eight scripts on this site cover the full path from “something feels slow” to a…
Written by
- sp_who vs sp_who2 vs sp_whoisactive in SQL Server
- The Evolution of SQL Server: Every Version from 1989 to 2025
- Cannot Execute As the Database Principal (Error 15517)
- Silent Failures: The SQL Server Problems That Never Raise an Error
- SQL Server Login Migration: What Gets Silently Left Behind
- CREATE USER WITHOUT LOGIN vs Contained Database Users
- Backups & Recovery (16)
- DBA Scripts (151)
- High Availability (HA) (12)
- Installation & Configuration (45)
- Maintenance (24)
- Migration & Upgrades (14)
- Monitoring (8)
- Performance Tuning (35)
- Security (Encryption & Permissions) (20)
- Storage & Capacity (14)
- T-SQL Fundamentals (11)
- Troubleshooting (55)
- Wait Types (235)