Tag: Troubleshooting
-
Diagnose SQL Server’s ‘String or Binary Data Would Be Truncated’ Error
String or binary data would be truncated: Msg 2628 names the table, column and value. How to diagnose it, and the setting that loses data silently.
Written by
-
Shrinking a SQL Server Database Causes Fragmentation: Measured, Not Just Stated
How to Shrink SQL Server Database Files in Chunks already says it plainly in its common pitfalls: shrinking causes index fragmentation, every time. That’s correct, and worth taking on faith from someone who’s had to clean up after it. It’s more useful with a real number attached. This post runs the actual before/after: a lab…
Written by
-
DBCC CHECKDB Found Corruption: What to Actually Do Next
DBCC CHECKDB reporting consistency errors is one of the few moments in this job that deserves to feel urgent. It usually also arrives with no warm-up: a query that worked yesterday throws a 5-digit error number nobody recognizes, or a scheduled DBCC CHECKDB job that’s passed silently for years suddenly doesn’t. This post reproduces a…
Written by
-
Parameter Sniffing in SQL Server: A Measured Example, Not Just the Theory
⚡Compare estimated rows with actual rows before you change anything. A big, consistent gap on one operator, in a plan compiled for a different parameter value, is sniffing (the check). Fix that statement, not the server: OPTION (RECOMPILE) on the one statement, or force the good plan with Query Store. A stored procedure that is…
Written by
-
Table Variables vs Temp Tables in SQL Server: What the Optimizer Actually Sees
The usual line on table variables vs temp tables is “table variables don’t have statistics, so the optimizer assumes 1 row.” That was true once. It isn’t the whole story on a current SQL Server, and the actual gap between what the optimizer assumes and what’s really there is worth measuring rather than repeating from…
Written by
-
Troubleshoot “Login Failed for User” (Error 18456) in SQL Server
Error 18456 login failed: the state number in the error log tells you why. How to find it and what each common state means, with the fix for each.
Written by
-
Troubleshoot RESOURCE_SEMAPHORE Waits in SQL Server (Memory Grant Pressure)
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. Unlike most waits, this one can genuinely hang a session for minutes with nothing else visibly…
Written by
-
Fix “Msg 207: Invalid Column Name” in SQL Server
Msg 207 invalid column name: the column is missing, misspelt, in another schema or table, or the query runs against a different database than you think.
Written by
-
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,…
Written by
-
Reading and Fixing a SQL Server Deadlock
Msg 1205 is SQL Server refusing to let two sessions wait on each other forever. Pull the deadlock graph from system_health, read it, and stop it recurring.
Written by
- Tune a Slow Query With Copilot in SSMS
- xp_readerrorlog: Read the SQL Server Error Log with T-SQL
- Cannot Drop Database Because It Is Currently in Use (Error 3702)
- Could Not Drop Login Because the User Is Currently Logged In (Error 15434)
- Set a Maximum Database File Size in SQL Server (MAXSIZE)
- SQL Server Activity Monitor in SSMS (and the Performance Dashboard)
- Backups & Recovery (18)
- DBA Scripts (154)
- High Availability (HA) (13)
- Installation & Configuration (60)
- Maintenance (25)
- Migration & Upgrades (14)
- Monitoring (10)
- Performance Tuning (38)
- Security (Encryption & Permissions) (25)
- Storage & Capacity (18)
- T-SQL Fundamentals (17)
- Troubleshooting (108)
- Wait Types (236)