Category: Troubleshooting
-
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…
Written by
-
DBA Scripts: Extended Events Tracing
🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Performance & Troubleshooting Ask most DBAs “what’s actually connecting to this server” or “is this database still in use” and you’ll get an opinion, not an answer. SQL Server doesn’t track any of this for you by default, no login history worth trusting,…
Written by
-
CREATE FILE Encountered Operating System Error (Error 5123)
SQL Server error 5123, CREATE FILE encountered operating system error. Why the service account is refused and how to fix the folder permissions.
Written by
-
Database in Recovery Pending: Cannot Be Opened (SQL Server Error 945)
SQL Server error 945, database cannot be opened due to inaccessible files. How to find which file stopped it and bring the database back online.
Written by
-
CREATE DATABASE Permission Denied (Error 262)
SQL Server error 262, CREATE DATABASE permission denied. Which permission is actually missing, who can grant it, and the least-privilege fix.
Written by
-
SQL Server Transaction Log Full
🚨Part of the SQL Server Errors series, the exact messages and what actually causes them.In: Storage & Capacity Msg 9002 · Level 17 · State 2 The transaction log for database ‘YourDb’ is full due to ‘LOG_BACKUP’ and the holdup lsn is (44:264:1). ⚡Check log_reuse_wait_desc first: it names the actual blocker out of about a…
Written by
-
SQL Server: The Database Is in Single User Mode (Fix)
You try to connect to a database and get: Or you attempt to switch it back to multi-user and receive: This usually happens after maintenance, a restore, or when someone has set the database to SINGLE_USER and not switched it back. In single-user mode, only one connection is allowed at a time. If anything else…
Written by
-
Hidden Log Performance Problem
VLF count is one of those checks that doesn’t appear in most performance reviews, doesn’t generate an alert, and doesn’t slow down any single query you can point to. It just makes everything involving the transaction log slower than it should be: backups, restores, recovery after a crash, AG synchronisation lag. I’ve seen databases with…
Written by
-
SQL Server Error Severities Explained
🚨Part of the SQL Server Errors series, the exact messages and what actually causes them. ⚡Read the Level before you read the message. 0 to 10 is informational, 11 to 16 means the statement is wrong and the server is fine, 17 to 19 is a resource limit or an engine fault and it is…
Written by
-
SQL Server: ALTER DATABASE SET ENABLE_BROKER Taking a Long Time (Fix)
After a recent Availability Group failover, Database Mail stopped sending emails. On investigation, the underlying cause was Service Broker not being enabled on msdb, the system database Database Mail runs out of. Enabling it should be instant. Instead the statement sat there, and this is what it was waiting on. To confirm the status, I…
Written by
- SQL Injection in Dynamic SQL: Use sp_executesql
- RESOURCE_SEMAPHORE When SQL Server Is Nowhere Near Its Memory Cap
- Dynamic Data Masking: What a WHERE Clause Still Reveals
- DBA Scripts: Get Log Shipping Status
- SQL Server Row-Level Security: The Filter Does Not Stop Cross-Tenant Writes
- View the Definition of a Stored Procedure in SQL Server
- Backups & Recovery (17)
- DBA Scripts (152)
- High Availability (HA) (13)
- Installation & Configuration (49)
- Maintenance (25)
- Migration & Upgrades (14)
- Monitoring (9)
- Performance Tuning (37)
- Security (Encryption & Permissions) (22)
- Storage & Capacity (16)
- T-SQL Fundamentals (15)
- Troubleshooting (95)
- Wait Types (235)