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
6,131 reads
This article looks at replacing a cursor with a window function to improve performance.
2026-08-03
6,131 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,220 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,848 reads
2026-05-22
532 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,258 reads
2025-02-26
461 reads
2025-02-12
560 reads
2024-10-30
474 reads
2024-10-23
434 reads
By Zikato
I deployed a schema change to 30 servers using multi-server query and deploy-at-low-priority. Small...
Fabric deployment pipelines look like they solve CI/CD for Fabric content, especially for people...
By Steve Jones
We aren’t the only company that does this, but Redgate Software does try to...
Hello We recently encountered an issue where a SQL table unexpectedly grew in size...
Comments posted to this topic are about the item The New World Of AI...
Thanks in advance, I'm trying to avoid using IIF for performance reasons, but the...
What does this return on SQL Server 2025?
select bit_count(null)See possible answers