Aaron Bertrand in SQL Server Days of the Week, Bitwise Edition I recently had to help support synchronization and distribution of workloads between multiple servers. Some of this work involves Task... 02 August 2024 7 min read
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 Part of a series: [ Part 1 | Part 2 | Part 3 | Part 4 ] In the previous... 27 May 2024 9 min read
T-SQL Programming Aaron Bertrand in T-SQL Programming Snake draft sorting in SQL Server, part 3 Part of a series: [ Part 1 | Part 2 | Part 3 | Part 4 ] In part 2... 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, part 1 Part of a series: [ Part 1 | Part 2 | Part 3 | Part 4 ] I recently had... 12 April 2024 8 min read
T-SQL Programming Aaron Bertrand in T-SQL Programming Pagination and ordering by large values Pagination is a technique for limiting output. Think of Google search results, shopping the electronics category on Amazon, or browsing... 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
T-SQL Programming Aaron Bertrand in T-SQL Programming Strategies for queries against bit columns Recently someone posted a question where they couldn’t quite figure out how to construct a predicate based on a bit... 20 November 2023 7 min read
Database Administration Aaron Bertrand in Database Administration Moving SQL Server To The Cloud: Modernizing Stack Overflow for Teams Earlier this year, we migrated the entire Stack Overflow for Teams platform to Azure. This was a lengthy endeavour and... 06 November 2023 11 min read
T-SQL Programming Aaron Bertrand in T-SQL Programming Don’t use DISTINCT as a “join-fixer” I’ve quietly resolved performance issues by re-writing slow queries to avoid DISTINCT. Often, the DISTINCT is there only to serve... 16 October 2023 6 min read
Performance Aaron Bertrand in Performance Normalize strings to optimize space and searches While this article is specifically geared to SQL Server, the concepts apply to any relational database platform. The Stack Exchange... 02 October 2023 9 min read
T-SQL Programming Aaron Bertrand in T-SQL Programming Working around schema drift in SQL Server At Stack Overflow, our environment has multiple implementations of a largely – but not 100% – identical schema. (By “schema,”... 14 August 2023 10 min read
T-SQL Programming Aaron Bertrand in T-SQL Programming Changing log growth strategy in SQL Server 2022 When I first saw a bullet item stating SQL Server 2022 would support instant file initialization for log file growth,... 15 May 2023 6 min read