I posted example scripts to automate RANGE LEFT sliding window maintenance in my last post. As promised, I am sharing a RANGE RIGHT version in this post.
I personally prefer a RANGE RIGHT partition function when partitioning on a data type that includes time. RANGE RIGHT allows specification of an exact date boundary instead of the maximum date/time value needed for RANGE LEFT to keep all data for a given date in the same partition. Another nicety with RANGE RIGHT is that same boundaries can be used in a RANGE RIGHT partition function of any date/time data type. In contrast, the...