I have a table ‘X’ and did the following
- CREATE PARTITION FUNCTION PF1(INT) AS RANGE LEFT FOR VALUES (1, 2, 3, 4)
- CREATE PARTITION SCHEME PS1 AS PARTITION PF1 ALL TO ([PRIMARY])
- CREATE CLUSTERED INDEX CIDX_X ON X(col1) ON PS1(col1)
this 3 steps created 4 logical partitions of the data I had.
My question is, how do I revert this partitioning to its original state ?
After 2 days of continuous searching
The Steps:
DROP INDEX CIDX_X on X/* drop the clustered */CREATE CLUSTERED INDEX CIDX_X1 ON X(col1) ON [PRIMARY]/* Create another clustered index on the table to free it from the partitioning scheme; Here, the “ON [primary]” part is key to removing the partition scheme from the table ! */DROP PARTITION SCHEME PS1DROP PARTITION FUNCTION PF1DROP INDEX CIDX_X1 ON X/* drop the dummy clustered index you created, as it was only created to free the table from the partitioning scheme */