Author: Peter Whyte
-
Diagnose SQL Server’s ‘String or Binary Data Would Be Truncated’ Error
🚨Part of the SQL Server Errors series, the exact messages and what actually causes them.In: Performance & Troubleshooting Msg 2628 · Level 16 · State 1 · Msg 8152 · Level 16 · State 30 Msg 2628: String or binary data would be truncated in table ‘SalesDemo.dbo.TruncTest’, column ‘code’. Truncated value: ‘TOOLO’. Msg 8152: String…
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
Parameter sniffing is SQL Server doing exactly what it’s supposed to do: compiling a query plan based on the actual parameter value passed in the first time it runs, then reusing that plan for later calls. That’s normally the right behavior, a plan built for the real value is usually better than a generic one.…
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
🚨Part of the SQL Server Errors series, the exact messages and what actually causes them.In: Security Error 18456 is the most common login failure in SQL Server, and the message you get is deliberately vague: Msg 18456 · Severity 14 Login failed for user ‘domain\user’. (Microsoft SQL Server, Error: 18456) ⚡The client normally receives only…
Written by
-
PAGEIOLATCH_SH Wait Type in SQL Server
⏳Part of the SQL Server Wait Types Library, every wait type explained.Related pillar: Storage & Capacity PAGEIOLATCH_SH appears when a query needs a data page that is not in the buffer pool, so SQL Server must read it from disk. The SH stands for shared latch, the read operation. The query waits until the I/O…
Written by
-
ASYNC_NETWORK_IO Wait Type in SQL Server
⏳Part of the SQL Server Wait Types Library, every wait type explained.Related pillar: Performance & Troubleshooting ASYNC_NETWORK_IO appears when SQL Server has finished producing rows and is waiting for the client application to read them from the network buffer. SQL Server filled its output buffer, the client hasn’t acknowledged it yet, and SQL Server is…
Written by
-
PAGELATCH_EX Wait Type in SQL Server
⏳Part of the SQL Server Wait Types Library, every wait type explained.Related pillar: Performance & Troubleshooting PAGELATCH_EX (and its sibling PAGELATCH_UP) is a latch wait on a page that is already in memory. That one word, memory, is the whole story. This is not disk I/O. If you see PAGE**IO**LATCH you have a storage problem;…
Written by
-
DBA Scripts: Get Job Schedules and Duration Trends
🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Maintenance & Automation › SQL Agent & Jobs When Jobs Run, and Whether They’re Taking Longer to Do It SQL Agent Job Failure Summary tells you what broke. These two scripts answer two quieter but just as important questions: Get-JobScheduleSummary shows exactly when…
Written by
- 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
- TempDB Is Full or Still Growing: Find What Is Using It, Right Now
- SQL Server Service Will Not Start: Error 17113, 17058, 1067 and Where the Real Reason Is
- How to Move TempDB Files 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) (20)
- Storage & Capacity (16)
- T-SQL Fundamentals (15)
- Troubleshooting (94)
- Wait Types (235)