Aaron Bertrand in SQL Server How to optimize planned availability group failovers in SQL Server Learn how to perform fast and predictable SQL Server planned Availability Group (AG) failovers. Discover tips to reduce downtime, optimize... 20 February 2026 15 min read 21
Aaron Bertrand in SQL Server How to fix the Invalid Length error in SQL Server Learn why SQL Server throws the invalid length error in functions like LEFT, SUBSTRING, and RIGHT, and discover practical fixes... 12 January 2026 5 min read 42
Aaron Bertrand in SQL Server How to fix the Invalid Object Name error in SQL Server Learn why SQL Server shows ‘Invalid object name’ errors and how to fix them. Common causes include typos, missing objects... 18 December 2025 6 min read 21
Aaron Bertrand in Featured Common SQL Server Problems: Network Related or Instance Specific Error Occurred This is the first in a series of articles meant to provide practical solutions to common issues. In this post,... 07 July 2025 6 min read
Aaron Bertrand in SQL Server SQL Server 2025 ZSTD Backup Compression Guide SQL Server 2025 adds Zstandard (ZSTD) backup compression with LOW, MEDIUM, and HIGH levels. Compare ZSTD vs MS_XPRESS performance, syntax,... 11 June 2025 15 min read 1
Aaron Bertrand in T-SQL Programming Five SQL Server Changes: DROP_EXISTING, ALTER TABLE, STRING_SPLIT Fixes Aaron Bertrand on five SQL Server behaviours he'd like Microsoft to fix: DROP_EXISTING needing an existing index, ALTER TABLE DROP... 01 January 2025 5 min read 64
Aaron Bertrand in SQL Server Storing Weekday Sets in SQL Server Using Bitwise Flags: Schedules and Recurring Jobs Store and query sets of weekdays in SQL Server using bitwise flags - each day encoded as a power of... 02 August 2024 7 min read 1
Aaron Bertrand in T-SQL Programming Index cleanup : Harder than it looks I’m not the first person to write about cleaning up unused or redundant indexes. You can read many articles about... 22 July 2024 7 min read
Aaron Bertrand in Database Administration It’s a recovery strategy, not a backup strategy I’ve talked about it before; you shouldn’t have a backup strategy, you should have a recovery strategy. I can’t possibly... 08 July 2024 12 min read
T-SQL Programming Aaron Bertrand in T-SQL Programming Snake Draft Sorting in SQL Server Part 4: Coordinating Parallel Job Completion Part 4 of the snake-draft sorting series - coordinating parallel SQL Agent jobs when work units finish at different times.... 27 May 2024 9 min read
T-SQL Programming Aaron Bertrand in T-SQL Programming Snake Draft Sorting in SQL Server Part 3: Balancing Work Across Tables Within One Database Part 3 of the snake-draft sorting series - extending the technique from balancing work across databases (parts 1-2) to balancing... 15 May 2024 5 min read
T-SQL Programming Aaron Bertrand in T-SQL Programming Snake draft sorting in SQL Server, part 2 Part of a series: [ Part 1 | Part 2 | Part 3 | Part 4 ] In my previous... 15 April 2024 7 min read
T-SQL Programming Aaron Bertrand in T-SQL Programming Snake Draft Sorting in SQL Server: Distributing Workloads Evenly (Part 1) Snake draft sorting in SQL Server divides processing tasks into evenly-distributed groups by assigning work in a serpentine order. Part... 12 April 2024 8 min read
T-SQL Programming Aaron Bertrand in T-SQL Programming SQL Server Pagination Performance: Sorting by Large Text Columns SQL Server OFFSET-FETCH pagination becomes extremely slow when sorting by large text columns (varchar(max), nvarchar(max)). Learn to fix it using... 25 March 2024 9 min read
Database Administration Aaron Bertrand in Database Administration Get the most out of SQL Server Agent logs If you haven’t migrated your workloads to a managed database platform yet, you’re probably still relying on SQL Server Agent... 11 March 2024 6 min read
Database Administration Aaron Bertrand in Database Administration Upgrade SQL Server on your workstation Lately, I’ve seen many people struggling to upgrade their workstation to the latest version of SQL Server. The main source... 26 February 2024 6 min read
Database Administration Aaron Bertrand in Database Administration Leave it better than you found it This is for the folks who still have to log into remote machines and do work manually on the box.... 12 February 2024 8 min read
Database Administration Aaron Bertrand in Database Administration Optimized locking in Azure SQL Database I don’t think I’ve ever had a great impression of Azure SQL Database as a place for production applications. In... 08 January 2024 8 min read
T-SQL Programming Aaron Bertrand in T-SQL Programming Counting more efficiently Nearly a decade ago, I wrote a post called “Bad habits : Counting rows the hard way.” In that post,... 20 December 2023 7 min read
T-SQL Programming Aaron Bertrand in T-SQL Programming When an update doesn’t update Tell me if you’ve heard this one before: I changed data from my application, but when I checked the database,... 27 November 2023 5 min read