SQL DBA Blog: Home

  • DBA Scripts: Get Permissions and Role Membership

    Part of the DBA-Tools Project. 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 role memberships across every online database, and membership…

    read more

  • DBA Scripts: Get Top CPU Queries

    Part of the DBA-Tools Project. 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 generate huge I/O, or it can just habitually run slowly every time regardless of resource…

    read more

  • DBA Scripts: Query and Performance Tuning

    Part of the DBA-Tools Project, in the Performance and Troubleshooting area. “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 specific, fixable cause: which…

    read more

  • 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…

    read more

  • SQL Server Transaction Log Full

    There are a handful of alerts that immediately change the tone of your day. “The transaction log for database ‘X’ is full” is one of them. When that happens, nothing writes. Applications start throwing errors. Jobs begin failing. Deployments stop mid-flight. In Availability Group environments, secondaries can start drifting behind. It rarely happens quietly. The…

    read more

  • 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…

    read more

  • SQL Server Recovery Models Explained

    Understanding SQL Server Recovery Models is fundamental to backup strategy, restore capability, and transaction log management. A recovery model determines two things: Get it wrong and you either lose restore precision or end up chasing log growth incidents. Every database runs under one of three models: Start by checking what you’re running: What Recovery Model…

    read more

  • SQL Server Builds: Complete Version List and Support Lifecycle (Updated 2026)

    This is the master reference I keep bookmarked for every SQL Server environment I touch. Whether you’re checking compatibility, planning an upgrade, or verifying the latest Cumulative Update, having the full build history in one place saves hours. I pulled and cleaned this from the excellent SQL Server Builds site and keep it current here…

    read more

  • 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…

    read more

  • 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…

    read more