Author: Peter Whyte
-
DBA Scripts: Get Permissions and Role Membership
🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Security Who Can Actually Do What, at Every Level Sysadmin Members answers the single highest-stakes question: who has unrestricted access. These four scripts answer everything underneath that: explicit object and schema grants inside a database, explicit server-level grants and denies on logins, database…
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 CPU is pinned and you need the statement behind it. Get-TopCpuQueries ranks the plan cache by total CPU. The two scripts beside it rank the same…
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. The scripts on this site cover the full path from “something feels slow” to a…
Written by
-
Understanding SQL Server AG Latency (AAG Latency Explained)
As a production SQL Server DBA, one of the fastest health checks I run on an Always On Availability Group is a latency check. AG latency is the delay between a transaction committing on the primary replica and that same transaction being hardened and redone on a secondary replica. If the secondary is behind, it…
Written by
-
SQL Server Transaction Log Full
🚨Part of the SQL Server Errors series, the exact messages and what actually causes them.In: Storage & Capacity Msg 9002 · Level 17 · State 2 The transaction log for database ‘YourDb’ is full due to ‘LOG_BACKUP’ and the holdup lsn is (44:264:1). ⚡Check log_reuse_wait_desc first: it names the actual blocker out of about a…
Written by
-
SQL Server: The Database Is in Single User Mode (Fix)
You try to connect to a database and get: Or you attempt to switch it back to multi-user and receive: This usually happens after maintenance, a restore, or when someone has set the database to SINGLE_USER and not switched it back. In single-user mode, only one connection is allowed at a time. If anything else…
Written by
-
SQL Server Recovery Models Explained
⚡If the log will not truncate, the database is almost certainly in Full recovery with no log backup running. Check log_reuse_wait_desc: LOG_BACKUP means back up the log, not shrink the file. Choosing a model is the same question from the other side (the comparison table): Full plus log backups for anything you would restore to…
Written by
-
SQL Server Builds: Complete Version List and Support Lifecycle
🔖 Living reference Every build number, KB and support date on this page comes from Microsoft’s official build and lifecycle pages, and the page is regenerated after each patch release. ✓ Data checked: 8 October 2026 Filed under Server & Configuration This is the reference I keep open for every SQL Server environment I touch.…
Written by
-
How to Check if Query Store Is Enabled in SQL Server
Query Store is one of the most useful features for troubleshooting query performance in SQL Server, but it is not always enabled or usable in the way people expect. In practice, Query Store might be: This post walks through how to check whether Query Store is enabled, how to see its current state, and how…
Written by
-
Hidden Log Performance Problem
VLF count is one of those checks that doesn’t appear in most performance reviews, doesn’t generate an alert, and doesn’t slow down any single query you can point to. It just makes everything involving the transaction log slower than it should be: backups, restores, recovery after a crash, AG synchronisation lag. I’ve seen databases with…
Written by
- SQL Server Row-Level Security: The Filter Does Not Stop Cross-Tenant Writes
- View the Definition of a Stored Procedure in SQL Server
- TempDB Is Full or Still Growing: Find What Is Using It, Right Now
- SQL Server Service Will Not Start: Error 17113, 17058, 1067 and Where the Real Reason Is
- How to Move TempDB Files in SQL Server
- RAND() vs NEWID() in SQL Server
- Backups & Recovery (17)
- DBA Scripts (151)
- High Availability (HA) (12)
- Installation & Configuration (49)
- Maintenance (25)
- Migration & Upgrades (14)
- Monitoring (9)
- Performance Tuning (37)
- Security (Encryption & Permissions) (20)
- Storage & Capacity (16)
- T-SQL Fundamentals (15)
- Troubleshooting (94)
- Wait Types (235)