Tag: SQL Scripts

Reusable SQL Server scripts for common DBA tasks, diagnostics, reporting, maintenance, and troubleshooting across production environments.

  • Script: Get Instance Configuration Snapshot

    This script returns a focused snapshot of instance-level configuration settings that DBAs commonly review when validating a server, inheriting an environment, or troubleshooting unexpected behaviour. It intentionally surfaces settings that have operational, security, or performance impact when misconfigured or left unchecked. The Script Example Output The result set shows the current values for key instance…

  • Script: Check MAXDOP Configuration

    This script shows the current MAXDOP setting and helps you quickly validate whether it’s likely to be sensible for the server you’re connected to. It includes the configured MAXDOP value and core visibility information so you can make an informed call without digging through multiple places. The Script Example Output The first result set shows…

  • Script: Get Memory Configuration and Usage

    This script shows how memory is configured for SQL Server and how much memory is currently being used. It helps confirm that instance-level memory settings are sensible and whether SQL Server or the host appears to be under memory pressure. This is commonly checked during performance investigations, post-build validation, and when reviewing servers that are…

  • Script: Get CPU Topology and Core Counts

    This script returns how CPU resources are presented to SQL Server, including NUMA nodes, CPU counts, and scheduler distribution. It helps confirm whether the instance is seeing the hardware as expected and whether CPU layout aligns with licensing, performance, and workload design. This is typically checked during performance investigations, new server validation, and post-migration reviews.…

  • Script: Check SQL Server Version and Edition

    This script returns the exact SQL Server version, build, edition, and servicing level for the current instance. It’s intended as a fast, reliable way to confirm what is actually running, without relying on UI dialogs or partial version strings. This is typically one of the first checks during troubleshooting, audits, upgrades, or when validating environments.…