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 SQL Join Fixer – Use EXISTS Instead Using DISTINCT to fix duplicate rows from a SQL join is a common antipattern. It generates all the duplicates first,... 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
T-SQL Programming Aaron Bertrand in T-SQL Programming One use case for NOT using schema prefixes I’ve long been a huge advocate for always referencing objects with a schema prefix in SQL Server.… 20 April 2023 6 min read
T-SQL Programming Aaron Bertrand in T-SQL Programming GENERATE_SERIES in SQL Server 2022: Syntax, Examples, and Performance vs Numbers Tables GENERATE_SERIES is the new built-in function in SQL Server 2022 and Azure SQL Database for producing a set of values... 30 March 2023 13 min read
Featured Aaron Bertrand in Featured Build a Better WordPress Archives Page Using MySQL I recently wrote about a way to generate visual, interactive calendars in HTML by combining a calendar table with data... 10 March 2023 15 min read
T-SQL Programming Aaron Bertrand in T-SQL Programming 40 Common Stored Procedure Problems in SQL Server Review 40 real stored procedure problems in SQL Server: naming conventions, error handling, NOCOUNT, temp table usage, sargability, schema binding,... 23 February 2023 22 min read