Category: SQL Server

SQL Server Blog Archives, by Peter Whyte (Database Administrator).
Includes: Database Admin, Management Studio (SSMS), Windows Admin, PowerShell, WSL, MSSQL Backups, Restores & more…

  • SQL Script to Get AAG Latency

    In this post, I’m sharing a script that I use frequently as a Production SQL DBA to check Always On Availability Group (AAG) latency. Always On Availability Groups (AAG) are a high-availability and disaster recovery solution in SQL Server, allowing you to synchronize databases across multiple replicas. These…

    Read More


  • SQL Server User Permissions Audit Script

    As a Production SQL DBA, checking user permissions is a task I handle frequently. Whether it’s for proactive audits, troubleshooting access issues, or responding to unexpected requests, having a quick and reliable way to verify user permissions is needed. One of the most useful tools I rely on…

    Read More


  • Creating SQL Logins on an Availability Group (AG) Environment

    In an Always On Availability Group (AG) environment, SQL logins must be configured with consistent Security Identifiers (SIDs) across all replicas to avoid issues like orphaned users and ensure seamless authentication during failovers. For Domain users in SQL, this sync’s automatically and we just need to create the…

    Read More


  • Keeping SQL Server and Critical Systems Up to Date

    Applying the latest patches to SQL Server, Windows OS, and underlying hardware is a vital part of maintaining secure, high-performing systems. For many organizations, this is done on a regular schedule—monthly, quarterly, or aligned with specific maintenance windows. However, for business-critical, 24/7 systems, patching takes extra planning and…

    Read More


  • How to Set the Default Database for SQL Server Users

    This blog post contains a quick guide on how to change your default database when you or your users next log in to SQL Server via SSMS. When you log into SQL Server using SSMS and open a new query window, you will automatically be set to use…

    Read More


  • How to Open SSMS as a Different Domain User

    If you’re working with SQL Server in a corporate environment, you might need to connect to the server using a different Domain User account, opening SQL Server Management Studio (SSMS) as a another user. This may be required if your computer is joined to a different Domain than…

    Read More


  • Troubleshooting Database Mirroring Issues in SQL Server

    Maintaining high availability and data integrity in a SQL Server environment is one of the main priorities as a SQL DBA. One issue we may encounter is Mirrored databases being left in a Disconnected or In Recovery state. In this article, we’ll share the different methods on how…

    Read More


  • What’s New in SQL Server 2025

    Microsoft announced SQL Server 2025 at Microsoft Ignite, with major new features focused on AI and integrating Azure SQL DB capabilities into on-premises servers. Check out this Microsoft Announcement post for more information: Announcing Microsoft SQL Server 2025: Enterprise AI-ready database from ground to cloud Key Features –…

    Read More


  • How to Kill SPIDs in SQL Server

    In SQL Server, Session Process IDs (SPIDs) play a crucial role in identifying and managing SQL connections. The KILL (SPID) command serves as a tool for terminating troublesome sessions. This blog post provides an overview of the KILL command and its practical applications. The following is included in…

    Read More


  • Move Temp DB SQL Server

    A common best practice for SQL Server DBA’s is to have Temp DB files stored on a separate drive, especially ensuring that it’s not on the C:\ drive and sharing with the OS. This is because Temp DB can grow very large, very quickly. The growth of Temp…

    Read More