Category: Query Tidbits

The Execute Permission Was Denied on the Object xp_sqlagent_notify After an SSRS Migration

I’ve come across an issue multiple times where after a SQL Sever migration that includes SSRS, subscriptions fail to recreate with an error message like “The EXECUTE permission was denied on the object xp_sqlagent_notify on database mssqlsystemresource. What has happened is a break in permissions that are assigned to the RSExecRole. The following list of […]

Rethinking Index Maintenance: Why avg_fragmentation_in_percent Is Outdated and What You Should Do Instead

As a SQL Server DBA with years of experience tuning production environments, I’ve seen the same patterns repeat: nightly index maintenance jobs running for hours, consuming massive CPU and I/O, only for performance to remain inconsistent or even degrade in some cases. Many of us (myself included, early in my career) relied heavily on avg_fragmentation_in_percent […]

How to Troubleshoot a Runaway Transaction Log File

Part of being a DBA is dealing with transaction logs that grow uncontrolled for some reason. This often gets raised to the DBA in the form of a drive space issue on the disk that contains the transaction log. Troubleshooting this can go a few different directions depending on the environment. Is the database in […]

The “Kill” Command: What to Consider Before Stopping a SQL Server Process

Whether you’re troubleshooting on-premises SQL Server, Azure SQL DB, Managed Instance, or Amazon RDS, you will eventually encounter a “lead blocker”—that one high-cost, long-running session holding every other process hostage. While your first instinct might be to issue a KILL command, the consequences vary wildly depending on what that session is actually doing. Here is […]

How to Reset the SA Password When You Get Locked Out

Getting locked out of a SQL Server instance can happen due to a number of situations. The most common scenario I’ve encountered is when a SQL Server is moved from one domain to another without the domain being trusted or having a local SQL admin account. I recently encountered another incident where a DBA was […]

How To Restore Change Data Capture – CDC Tables When Restoring a SQL Server Database

I have recently had the privilege of working with multiple clients who have been taking advantage of Change Data Capture “CDC”. Change Data Capture is a feature that utilizes SQL Server Agent to log inserts, updates, and deletes occurring in a table. It makes these data changes available to be consumed in a relational format. […]