SQL DBA Blog: Home

  • DBA Scripts: High Availability

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks. High availability isn’t one technology, SQL Server ships several: Always On Availability Groups (the current, supported approach), Database Mirroring (deprecated since 2012 but still running in plenty of environments), Failover Cluster Instances, Log Shipping, and Replication (which trades availability guarantees for data distribution…

    Read More


  • DBA Scripts: Get Replication Agent Status

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: High Availability Publications Look Fine. Are the Agents Actually Keeping Up? Replication Status tells you what’s published and subscribed. It doesn’t tell you whether the jobs actually moving that data, the Log Reader Agent and the Distribution Agent, are keeping up, or whether…

    Read More


  • DBA Scripts: Get Last Node Blip

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: High Availability When Did This FCI Last Move, and Why On a Failover Cluster Instance (FCI), every node blip, planned or not, causes SQL Server to restart on whichever node picks it up. That restart resets sqlserver_start_time, which makes instance uptime itself a…

    Read More


  • DBA Scripts: Get Mirroring Endpoint Health and Status

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: High Availability Still Running Database Mirroring? Here’s What to Check Database Mirroring has been deprecated since SQL Server 2012, and Always On Availability Groups are the replacement for any new deployment. Deprecated doesn’t mean gone though. Plenty of instances still run it, migrations…

    Read More


  • DBA Scripts: Get AG Failover Readiness and Readable Secondary Usage

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: High Availability Would a Failover Succeed Right Now, and Can Reads Reach the Secondary? A failover is coming, planned or not, and you need to know what it costs before anyone presses the button. Get-AgFailoverReadiness answers it per database, per replica: can it…

    Read More


  • SSMS Results Grid: Export to Excel, JSON and Markdown

    🛠️Part of the SSMS Complete Guide, installing, configuring and fixing SQL Server Management Studio.Related pillar: Server & Configuration For twenty years the way query results left SSMS was copy, paste into a spreadsheet, fix the columns the paste mangled. SSMS 22 quietly ended that: the results grid now saves straight to Excel, JSON, Markdown and…

    Read More


  • DBA Scripts: Storage and Capacity

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks. A SQL Server running out of room fails in several different ways depending on exactly which resource ran out: a full data file stops inserts, a full log file freezes the whole database, a full disk volume takes down everything on it, and…

    Read More


  • DBA Scripts: Get Filegroup Space

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Storage & Capacity The Filegroup That’s Actually About to Run Out Database Free Space Summary tells you a database has plenty of room overall. That can still be wrong for a specific filegroup: a database on multiple filegroups can look comfortable in total…

    Read More


  • DBA Scripts: Get Database Growth Risk and Forecast

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Storage & Capacity Two Different Questions: “Is It Close?” and “When Will It Hit?” “How close is this database to its configured size limit?” and “at its current growth rate, when will it actually get there?” are two different questions, and answering them…

    Read More


  • DBA Scripts: Get Database Free Space Summary

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Storage & Capacity Allocated vs Used, Split by Data and Log, Every Database, One Pass A write has just failed and the drive it lives on still shows free space. This script reports how much room is left inside the database files themselves…

    Read More