SQL Server hierarchyid: A Built-In Alternative to Recursive CTEs
Learn how SQL Server’s hierarchyid data type stores and queries tree structures without recursive CTEs, with practical examples for org charts and hierarchical data.
Recursive CTEs in SQL Server: How the Parts Actually Work Together
A plain-language walkthrough of recursive CTEs in SQL Server, breaking down the anchor, the recursive member, and the iteration cycle so the syntax finally makes sense.
A Better Cursor Pattern for SQL Server: Cursor Variables and @@CURSOR_ROWS
Replace the traditional WHILE @@FETCH_STATUS cursor loop with a cleaner pattern using cursor variables, STATIC cursors, and @@CURSOR_ROWS for more readable, less error-prone T-SQL.
Eliminating Legacy Cursors: An AI-Assisted Deep Dive
A deep dive into decomposing complex legacy cursors with AI using the bulk-first, loop-for-side-effects pattern.
Diagnosing Parameter Sniffing with AI
Use AI to analyze execution plan XML, identify sniffed values, and evaluate RECOMPILE, OPTIMIZE FOR, and PSP optimization.
Eliminating Cursors with AI-Generated Set-Based Alternatives
Feed a cursor-based procedure to AI and get a set-based rewrite with honest advice about when cursors are still right.