You already know what is Data Partitioning in SQL Server. It’s nothing new. But turns out that there is a shortage of solutions available online for easily managing partitioned tables.
Sure, there are a bunch of blog posts and guides and webinars about WHAT is partitioning in SQL Server, and WHAT is a “Sliding Window“… And sure, there is even enough information out there to help you construct your own partition sliding window maintenance for your specific partition functions and schemas and tables.
But if you know me, you should already know that my idea of a “best solution”… is a GENERIC solution. One that could be easily reused for multiple different use cases. One that requires minimum customizations and coding to work for as many different scenarios as possible.
Unfortunately, I wasn’t able to find such an existing solution anywhere.
That is why I created The Best Solution for implementing SQL Server Partitioning Sliding Window. Namely – a GENERIC one.
(yeah I know it’s a rather pretentious and self-serving title… But I had to catch your attention somehow, didn’t I?)
Anyways, the solution consists of two stored procedures, both available in our GitHub repository:
There are also a few more useful scripts within the same folder:
- Create partition function and partition scheme.sql – A template script to create an entirely new partition function and partition scheme
- Collect Partitioning Information.sql – A query to output detailed meta-data about any partitions that currently exist in your database
For more details, please read the full post published at the official Madeira Data Solutions site.
There’s also a README file with instructions available within the same GitHub folder.