Edward Pollack in T-SQL Programming Store & Parse JSON in SQL Server: Strategy Guide Learn how to store, validate, index, and compress JSON in SQL Server. Covers ISJSON, OPENJSON, JSON_VALUE, computed columns, the Azure... 23 August 2024 27 min read 311
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
Edward Pollack in T-SQL Programming XML Performance Tuning and Added Options SQL Server provides a variety of ways to tune XML so that it provides consistent performance, consumes less space, all... 21 June 2024 12 min read
T-SQL Programming Edward Pollack in T-SQL Programming Store, Parse & Convert XML in SQL Server Master XML handling in SQL Server: store XML in typed columns, parse with XQuery and OPENXML, convert between XML and... 03 June 2024 22 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 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 9 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