geohernandez - Journey of a Data Engineer and Data Architect apprentice
  • ABOUT
  • CONTACT ME
  • WORK WITH GEO
    • Data Specialist
    • Speaker Events
    • Resume
  • EnglishEnglish
    • EnglishEnglish
    • EspañolEspañol
ABOUT
CONTACT ME
WORK WITH GEO
    Data Specialist
    Speaker Events
    Resume
English
    English
    Español
geohernandez - Journey of a Data Engineer and Data Architect apprentice
  • ABOUT
  • CONTACT ME
  • WORK WITH GEO
    • Data Specialist
    • Speaker Events
    • Resume
  • EnglishEnglish
    • EnglishEnglish
    • EspañolEspañol
Chronicles from the trenches•T-SQL

Implementing CTE for filling gaps inside a sequence

November 15, 2018 by geohernandez 1 Comment

This is the second article of a series dedicated to implementing Recursive Common Table Expression in different kind of scenarios, and this time I will address another use case; it basically consists in filling gaps inside a sequence of an incomplete range of dates.  I would like to comment that the next example has been taken from MSDN forum, I have chosen because I think it is an excellent way to prove how versatile the recursive CTE is, the most creative solution was proposed by Peter Larsson (swePeso) and he brought us  a valid and optimal implementation which is useful since SQL Server 2005 and up versions.

Continue reading
Share:

Search for articles

Recent Posts

  • Using interpolated format strings in Python
  • Getting the last modified directory with Python
  • First steps for configuring SQL Server with Docker

Categories

  • Azure (5)
  • Azure DevOps (2)
  • Bash script (1)
  • Blog (1)
  • Cassandra (3)
  • Chronicles from the trenches (23)
  • Data Engineering (5)
  • DB optimization (2)
  • Events (2)
  • GIT (1)
  • MySQL (1)
  • Python (5)
  • SQL Saturday (1)
  • SSIS (2)
  • T-SQL (5)
  • Uncategorized (1)

Archives

  • December 2022 (1)
  • November 2022 (1)
  • July 2022 (1)
  • March 2022 (1)
  • September 2021 (1)
  • May 2021 (1)
  • March 2021 (1)
  • February 2021 (3)
  • December 2020 (1)
  • October 2020 (3)
  • September 2020 (1)
  • August 2020 (1)
  • January 2020 (1)
  • August 2019 (1)
  • July 2019 (1)
  • June 2019 (1)
  • May 2019 (1)
  • April 2019 (1)
  • March 2019 (1)
  • November 2018 (3)
  • October 2018 (1)
  • September 2018 (1)
  • August 2018 (2)

© 2022 copyright Geo Hernandez // All rights reserved     Step by Step