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
3,431 reads
This article looks at replacing a cursor with a window function to improve performance.
2026-08-03
3,431 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,014 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,651 reads
2026-05-22
508 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,208 reads
2025-02-26
443 reads
2025-02-12
551 reads
2024-10-30
455 reads
2024-10-23
410 reads
By Steve Jones
I have been experimenting with MCP servers in a few ways, and pressing on...
Programmatic Tool Calling with the Claude SDK Every morning somebody on the team runs the...
By Steve Jones
mauerbauertraurigkeit – n. inexplicable urge to push people away, even close friends whose company...
Hello experts, An application team has asked us to modify a SQL Agent job....
Comments posted to this topic are about the item Advanced T-SQL: Replacing Slow Cursors...
Comments posted to this topic are about the item Finding Bad Queries