Advanced T-SQL: Replacing Slow Cursors with Window Functions
This article looks at replacing a cursor with a window function to improve performance.
2026-08-03
5,517 reads
This article looks at replacing a cursor with a window function to improve performance.
2026-08-03
5,517 reads
Introduction When developers first learn SQL aggregation, they usually start with the GROUP BY clause. It works well for summary reports because it combines multiple rows into a single result for each group. For example, you can calculate total sales per region or average salary per department. The limitation of GROUP BY appears when you […]
2026-06-05
4,076 reads
SQL Server 2022 brought powerful new T-SQL functions that eliminate long-standing workarounds. This article walks through five of the most impactful additions — GENERATE_SERIES, GREATEST/LEAST, DATE_BUCKET, the WINDOW clause, and IS NOT DISTINCT FROM — with practical code examples you can use immediately.
2026-05-29
6,712 reads
2026-05-22
515 reads
I’ve used SQL window functions for years, but I’ve never fully understood framing. To truly master window functions, you need at least a basic grasp of framing and how to apply it to your queries. Framing is especially helpful when working with aggregate functions. How can you overcome this hesitation to try framing?
2025-12-26
A look at window functions in SQL and how they can be used to query data without the restrictions of a GROUP BY.
2025-09-12
7,223 reads
2025-02-26
452 reads
2025-02-12
555 reads
2024-10-30
465 reads
2024-10-23
418 reads
A nightly load into sales_fact fails. Ask an orchestrating agent to break down the...
By Steve Jones
It’s been some time since I provided a car update, so I decided to...
By James Serra
An architecture scenario Imagine separate Sales, Finance, Shared Data, and Executive Analytics workspaces. Sales...
I have a really stupid question... Is there an easy way to search for...
Comments posted to this topic are about the item How to Work with On-Premises...
Comments posted to this topic are about the item Escaping Strings
The STRING_ESCAPE() function requires 2 parameters in SQL Server 2025. The first is a string of text and the second is the type of escape rules being used. What are the options for the second parameter?
See possible answers