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 10 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
T-SQL Programming Edward Pollack in T-SQL Programming Find and Replace Text in Strings in T-SQL String manipulation is an inevitable task for developers and data professionals alike. Despite all the best efforts to normalize databases,... 29 February 2024 17 min read
Database Administration Edward Pollack in Database Administration The Importance of Retention It is always an afterthought. New objects are created that start off small and current. New feature development takes over... 19 January 2024 24 min read
T-SQL Programming Itzik Ben-Gan in T-SQL Programming Two-Dimensional Interval Packing in SQL Server: Itzik Ben-Gan’s Unpack/Pack Solution Itzik Ben-Gan's two-dimensional interval packing challenge in SQL Server: packing overlapping student schedule intervals across date and period axes. Complete... 02 January 2024 17 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
T-SQL Programming Edward Pollack in T-SQL Programming Export & Import Data in SQL Server: CSV, Parquet & PowerShell Export and import data in SQL Server using PowerShell and OPENROWSET. Step-by-step guide for CSV files, parquet format, BCP, SQL... 23 October 2023 23 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 Itzik Ben-Gan in T-SQL Programming T-SQL Fundamentals: Controlling Duplicates When people start learning a new field, for example T-SQL, it’s tempting to spend very little time trying to understand... 28 September 2023 20 min read
T-SQL Programming Drupal Grupal in T-SQL Programming Alternatives To SQL Server 2022 Built-in function GREATEST If you haven’t already heard, SQL Server 2022 introduced a new built-in system function called GREATEST. Simply put, it is... 18 September 2023 14 min read
Other Louis Davidson in Other Yet Another Reason to Not Use sp_ in SQL Server Object Names In 2012, Aaron Bertrand said most everything I knew (and a bit more) about the issues with using the sp_... 25 August 2023 6 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
SQL Server Ben Johnston in SQL Server Unmasking SQL Server Dynamic Data Masking, Part 5: Mitigations and Summary This is the fifth and final part of this series on SQL Server Dynamic Data Masking. In this article, I’ll... 30 July 2023 12 min read
SQL Server Ben Johnston in SQL Server Unmasking SQL Server Dynamic Data Masking, Part 4, Unmasking Formatted and Unformatted Text Continuing from the previous entry in this series on security concerns with using Dynamic Data Masking, in this article I... 27 June 2023 30 min read