Author: Peter Whyte
-
DBA Scripts: Generate Backup Jobs
🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Maintenance & Automation › Maintenance Job Framework A Readable Generator for Full Backups, Log Backups, and Cleanup If you’re already running Ola Hallengren’s maintenance solution, this won’t replace it, but the approach here might still be useful: a small, readable T-SQL generator that…
Written by
-
JSON in SQL Server: OPENJSON, FOR JSON, and the Native JSON Type
SQL Server has had JSON functions since 2016, and SQL Server 2025 added a native JSON data type on top of them. Most write-ups explain the syntax; fewer show what actually differs between storing JSON as text and storing it as the native type, or when reaching for JSON in a relational database is the…
Written by
-
DBA Scripts: Run a Full SQL Server Health Check
🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Maintenance & Automation › Collectors & Baselines Most of the 180+ scripts on this site answer one specific question, run when you already know what you’re looking for. This post is different. It’s the workflow for the moment you don’t know what to…
Written by
-
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. Msg 8152 (pre-2019) · Msg 2628 (2019+) · Level 16 String or binary data would be truncated. ⚡On SQL Server 2019 and later the error names the table, column and value. On earlier versions it tells you nothing, so the…
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. 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 the…
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
Start Here
- DBA Scripts: The Complete Guide
- Run a Full Health Check
- DBA Scripts & Tools
- SSMS: The Complete Guide
- SQL Server Errors: The Complete Guide
- Wait Types Library
The Pillars
Blog Categories
- Backups & Recovery (16)
- DBA Scripts (151)
- High Availability (HA) (12)
- Installation & Configuration (38)
- Maintenance (24)
- Migration & Upgrades (14)
- Monitoring (7)
- Performance Tuning (35)
- Security (Encryption & Permissions) (20)
- Storage & Capacity (14)
- T-SQL Fundamentals (11)
- Troubleshooting (55)
- Wait Types (235)
Latest Posts
- Cannot Execute As the Database Principal (Error 15517)
- Silent Failures: The SQL Server Problems That Never Raise an Error
- SQL Server Login Migration: What Gets Silently Left Behind
- CREATE USER WITHOUT LOGIN vs Contained Database Users
- The sqldba MCP Server: Give Your AI Assistant a Verified SQL Server Reference
- Cannot Resolve the Collation Conflict (Error 468)
Blog Tags
Access (4) Always On Availability Groups (4) Auditing (7) Backups (6) Blocking (4) Blocking Locking (6) Collectors (7) Database Backups & Recovery (8) Database Backups and Recovery (5) Database Maintenance (7) DBA Tools (24) Disk Space (5) Error Log (3) Extended Events (8) Features (6) High Availability (6) Indexes (7) Installation (7) Inventory (8) Maintenance (6) Migration (14) Monitoring (27) Performance (21) Performance Troubleshooting (9) PowerShell (4) Query Behaviour (5) Security (10) SQL Agent (5) SQL Scripts (17) SQL Server Administration (10) SQL Server Configuration (7) SQL Server Errors (5) SQL Server High Availability (4) SQL Server Internals (3) SQL Server Management Studio (SSMS) (6) SQL Server Monitoring (7) SQL Server Networking (9) SQL Server Security (7) Storage and Capacity (7) T-SQL (10) Temp DB (3) Tracing (7) Transaction Logs (4) Troubleshooting (24) Windows Server (4)