Scripting Changes to Partitioned Tables with SQL Compare

Scripting Changes to Partitioned Tables with SQL Compare

Dec 3, 2020

A customer recently asked if Redgate's comparison engine is able to generate code to split partitions when a partitioned table is modified. Yes, it can! In this video we demonstrate this in SQL Compare, but the same functionality is also available for automated deployments from SQL Source Control and SQL Change Automation, which use the SQL Compare Engine.

00:00 Explaining the question background
00:41 Setting up the comparison in SQL Compare
01:10 Why the differences don't show up: we need to ensure that we do NOT ignore filegroups, partition schemes, and partition functions
02:00 Reviewing the differences between my partition functions
02:33 Generating a deployment script
02:53 Reviewing the scripted changes for the partition schema and the partition function
03:30 Comments on what happens if you are splitting partitions which have a large amount of data

If you do need to split existing partitions which have data in them, this blog post may help: https://littlekendra.com/2016/01/26/partitioned-tables-missing-boundary-points/