Deleting and loading bulk data by splitting, merging, and switching partitions (sliding window)

Many times there is a requirement to archive or delete a large amount of data and load a large amount of new data into a large table periodically, based on the date and time column. Let's say for example, you regularly need to delete a large amount of data that belongs to the oldest quarter. At the same time, you want to load a large amount of data into an existing table. With billions of rows in a table, this operation is not trivial and can take hours. However, if you implement table partitioning based on the date and time column, you can perform this task very efficiently.

In this recipe, we will learn how to efficiently delete a large amount of ...

Get Microsoft SQL Server 2012 Performance Tuning Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.