Author: Peter Whyte

  • DBA Scripts: Server Inventory

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Server & Configuration Start Here What version, edition and patch level is this?Version and EditionWhat hardware is it actually running on?OS and Hardware InfoWhat has been changed from the defaults?Configuration SnapshotAre we using features this edition is not licensed for?Edition Feature UsageWhat databases…

  • QUERY_EXECUTION_INDEX_SORT_EVENT_OPEN Wait Type in SQL Server

    ⏳Part of the SQL Server Wait Types Library, every wait type explained.Related deep dive: IO_COMPLETION Wait TypeRelated pillar: Performance & Troubleshooting QUERY_EXECUTION_INDEX_SORT_EVENT_OPEN is recorded during parallel offline index builds, when the worker threads performing the sort synchronise access to the shared sort files and wait for each other to finish their portions. Index creation is…

  • SLEEP_TASK Wait Type in SQL Server

    ⏳Part of the SQL Server Wait Types Library, every wait type explained.Related deep dive: IO_COMPLETION Wait TypeRelated pillar: Performance & Troubleshooting SLEEP_TASK is a general-purpose wait recorded when a task sleeps waiting for some event that has no more specific wait type. It covers background task scheduling gaps, some parallel plan exchange operators, buffer free-list…

  • SQL Server Wait Types Library

    ,

    Wait statistics are the single best first step in any SQL Server performance investigation. Every time a query waits on a resource, whether that’s a lock, disk I/O, a transaction log flush, a memory grant, or something else, SQL Server records it. By the time a performance problem appears, the evidence is usually already sitting…

  • Troubleshoot RESOURCE_SEMAPHORE Waits in SQL Server (Memory Grant Pressure)

    ⏳Part of the SQL Server Wait Types Library, every wait type explained.Related pillar: Performance & Troubleshooting RESOURCE_SEMAPHORE means a query is waiting for a workspace memory grant, memory SQL Server reserves up front for sorts, hashes, and other operators before the query is allowed to run at all, and there isn’t enough available right now.…

  • Fix “Msg 207: Invalid Column Name” in SQL Server

    🚨Part of the SQL Server Errors series, the exact messages and what actually causes them. Msg 207  ·  Level 16  ·  State 1 Invalid column name ‘X’. ⚡The column does not exist in the context the query is running in. Before assuming a typo, check you are on the database you think you are on,…

  • DBA Scripts: Get Linked Servers

    ,

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Server & Configuration › Server Inventory Four Questions, One Topic: What’s Linked to This Server Linked servers are the kind of configuration that gets set up once, for one integration, and then forgotten until a migration or an incident forces someone to ask…

  • Troubleshoot SQL Server Blocking, Step by Step

    Blocking isn’t a bug, it’s SQL Server enforcing correctness: one session holds a lock, another wants a conflicting one, and it has to wait. Most blocking resolves in milliseconds and nobody notices. The problem is blocking that doesn’t resolve fast, a query queued behind a session that’s holding a lock far longer than it should,…

  • Reading and Fixing a SQL Server Deadlock

    🚨Part of the SQL Server Errors series, the exact messages and what actually causes them. Msg 1205  ·  Level 13  ·  State 51 Transaction (Process ID 52) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction. ⚡The engine picked the cheaper transaction to kill, and…

  • DBA Scripts: Fix Orphaned Users

    ,

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Migration & Deployment From Finding Orphaned Users to Actually Fixing Them Get Orphaned Users answers “do I have this problem”. This script answers the next question: “what do I actually run to fix it”. After a database restore onto a server where the…