Scripts and Tools

Ready-to-run T-SQL scripts, PowerShell tools, utilities, and downloadable advisors for SQL Server DBAs.

Monitoring Row Count Drift Between Source and Remote Destination

Monitoring Row Count Drift Between Source and Remote Destination When you run imports, ETL, or replication, one of the simplest early-warning checks is: “do the row counts match?”It isn’t a full validation, but it catches common problems like “replication is behind” or “ETL stopped loading” before end users notice. This blog gives you a full […]

Monitoring Row Count Drift Between Source and Remote Destination Read More »

Windows + SQL Server: Building a Weekly Health Check with PowerShell

Every DBA needs a predictable way to keep both Windows and SQL Server systems healthy. Instead of juggling GUIs, Task Scheduler jobs, and one-off commands, a single PowerShell health check script can handle your daily or weekly routines consistently. This post walks through: The script is fully commented and written with original function names so

Windows + SQL Server: Building a Weekly Health Check with PowerShell Read More »

Meet sys.dm_os_memory_health_history in SQL Server 2025

Understanding memory health in a deeper, more continuous way What is it? In SQL Server 2025, Microsoft introduced a new dynamic management view (DMV) called sys.dm_os_memory_health_history. Microsoft Learn Key points: Why it matters If you’ve worked with earlier versions of SQL Server, you know memory pressure is one of the trickier diagnostics: sometimes everything looks

Meet sys.dm_os_memory_health_history in SQL Server 2025 Read More »

Why You See NT AUTHORITY\SYSTEM Updating Schema in SQL Server — and What to Do About It

One question I often get from DBAs and developers is: “Why do I see NT AUTHORITY\SYSTEM or LOCAL SERVICE in my SQL logs making schema or metadata changes?”At first glance, this can look suspicious. Did the operating system just change my database? Is this a security risk? Let’s break it down. What’s Actually Happening When

Why You See NT AUTHORITY\SYSTEM Updating Schema in SQL Server — and What to Do About It Read More »

SQL Server Trace Flags — Comprehensive Guide (with Versions & Always On AG Flags)

What trace flags are (quickly) Trace flags are switches that alter SQL Server engine behavior. Some are documented/supported by Microsoft; many are undocumented (internal, historical, or fix-gated). Use them carefully, test in lower environments first, and document who turned them on, why, when, and how to roll back. How to see / enable / disable

SQL Server Trace Flags — Comprehensive Guide (with Versions & Always On AG Flags) Read More »

PolyBase on SQL Server 2019 & 2022 : from setup to real-world data virtualization

This post focuses on PolyBase for on-prem (or IaaS) SQL Server—not Synapse or Fabric. We’ll cover what PolyBase is, how “virtual data” works, what changed from 2019 to 2022, when it helps DBAs, developers, data-warehouse, and data-science teams, and how to set it up with copy-paste T-SQL examples. ⚠️ Important: PolyBase is great for accessing

PolyBase on SQL Server 2019 & 2022 : from setup to real-world data virtualization Read More »

Tools & Connectivity with SQL Server in 2025: The Smart DBA’s Guide

If you manage SQL Server today, chances are you touch on-prem instances, cloud databases, and maybe a few containers. The toolbelt you pick matters for performance, reliability, and day-to-day sanity. Here’s a clean, opinionated rundown of what to use (and when), with pros/cons, gotchas, and credible references. 1) Microsoft-native tools SQL Server Management Studio (SSMS)

Tools & Connectivity with SQL Server in 2025: The Smart DBA’s Guide Read More »

When Your SQL Server Database Goes SUSPECT (and How to Prevent It)

It’s one of the scariest things to see in SQL Server Management Studio:your database suddenly marked as SUSPECT. This post breaks down what that means, why it happens, how to fix it step by step, which trace flags might help, and—just as important—how to prevent it from happening in the first place. What “SUSPECT” Mode

When Your SQL Server Database Goes SUSPECT (and How to Prevent It) Read More »

SQL Server Blocking Detection Without SQL Agent: A Service Broker Timer Solution

SQL Server Blocking Detection Without SQL Agent: A Service Broker Timer Solution – SQLYARD Leave a Comment / Articles, Operations, Scripts and Tools / By SQLYARD SQL Server Blocking Detection Without SQL Agent: A Service Broker Timer Solution By SQLYARD · SQLYARD.com · Updated June 2026 · Estimated read: 30–35 min SQL Server Agent is

SQL Server Blocking Detection Without SQL Agent: A Service Broker Timer Solution Read More »

Proactive SQL Replication Monitoring: Errors, Backlog, and Smart Email Alerts

Replication is great until it gets quiet and drifts out of sync. The fix is simple: collect errors and backlog on a schedule, keep a local audit trail, and email the team only when action is needed. This guide gives you a full solution you can paste into SSMS and run. You will: What you

Proactive SQL Replication Monitoring: Errors, Backlog, and Smart Email Alerts Read More »

SQL Data Migration Playbook: PostgreSQL ↔ SQL Server

How to plan, convert, move, and validate—without surprises Migrating between PostgreSQL and SQL Server (including AWS RDS/Aurora) can feel daunting, but with the right framework you can make it predictable and repeatable. This post covers several scenarios: Postgres-to-Postgres, SQL Server-to-Postgres, Postgres-to-SQL Server, and how to use Microsoft’s SQL Server Migration Assistant (SSMA). Along the way,

SQL Data Migration Playbook: PostgreSQL ↔ SQL Server Read More »

Diagnosing and Fixing “Out of Space” Errors on the PRIMARY Filegroup in SQL Server

When running schema changes or creating indexes in SQL Server, you may encounter an error like this: This is not a tool-specific problem. It means SQL Server attempted to allocate space in the PRIMARY filegroup but could not grow the data file. Until the underlying space issue is fixed, operations such as index creation, schema

Diagnosing and Fixing “Out of Space” Errors on the PRIMARY Filegroup in SQL Server Read More »

SQL Profiler is deprecated. Use Extended Events instead

Summary SQL Trace and SQL Server Profiler are deprecated. They still open, but Microsoft invests in Extended Events. Extended Events gives lower overhead, more coverage across the engine, richer filtering, and server-side capture that you can script and automate. For daily performance work, auditing, and triage, Extended Events is the right tool. Bottom line: Move

SQL Profiler is deprecated. Use Extended Events instead Read More »

Best Practices for Running SQL Server on VMware vSphere & vCenter (Part 2: Storage, Memory, and Instance Configuration)

This article continues from Part 1, where we looked at CPU, NUMA, and vSphere configuration best practices for SQL Server in a virtualized environment. In Part 2, we shift focus to storage and memory considerations, file initialization settings, instance design strategies, and how DNS aliases can simplify management. These optimizations build on the foundation from

Best Practices for Running SQL Server on VMware vSphere & vCenter (Part 2: Storage, Memory, and Instance Configuration) Read More »

SQL Server Indexes for New DBAs: From “What is this?” to “I’ve got this.”

If you’re new to SQL Server and you want query speed without guesswork, learn indexes. This guide walks you from first principles to advanced tuning with practical T-SQL you can try today. 1) What an index is (in plain English) An index is a data structure that helps SQL Server find rows faster. Instead of

SQL Server Indexes for New DBAs: From “What is this?” to “I’ve got this.” Read More »

Part 3 — Log, Trend, and Dashboard Your SQL Error and Warning Findings

This builds on Part 2. Instead of only emailing what happened in the last 24 hours, we will: Everything below is copy-paste ready. Replace placeholders like YourUtilityDB, YourDatabaseMailProfile, ops@example.com, and linked server names as needed. Schedule it Create a SQL Agent job that runs: Run it once daily. On critical systems, run it every hour

Part 3 — Log, Trend, and Dashboard Your SQL Error and Warning Findings Read More »

Part 2 — Automate & Prioritize the SQL Server Error Log

Group counts, suppress noise, and email a clean daily report This follow-up builds on Part 1. Instead of reading the entire error log by hand, we’ll scan the last N hours, classify messages as Errors or Warnings, suppress known noise, group duplicates with counts, and email a compact HTML report. There’s also a section for

Part 2 — Automate & Prioritize the SQL Server Error Log Read More »

Part 1 – How to Review the SQL Server Error Log like a DBA

The SQL Server Error Log is your first stop when something looks off. It records startup messages, configuration changes, critical errors, I/O problems, login failures, backup issues, and more. A fast daily review catches trouble before it becomes an outage. Where to find the Error Log In SSMS On disk (default paths) Tip: Keep several

Part 1 – How to Review the SQL Server Error Log like a DBA Read More »