Hi @Aiman Kreidly
You can create a temporary table with the same structure as a partitioned table, switching partitions from the partitioned table to be dropped. Then drop the temporary table.
Just like this:
CREATE TABLE PartitionTable (col1 int, col2 char(10))
ON myRangePS1 (col1) ;
GO
CREATE TABLE StagingTable (col1 int, col2 char(10))
ON test2fg ;
GO
ALTER TABLE PartitionTable SWITCH PARTITION 2 TO StagingTable ;
GO
DROP TABLE StagingTable ;
GO
For more information about table partitioning, here is a good post that you can refer to.
https://www.patrickkeisler.com/2013/01/how-to-remove-undo-table-partitioning.html
Best regards,
Percy Tang
If the answer is the right solution, please click "Accept Answer". If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our Documentation to enable e-mail notifications if you want to receive the related email notification for this thread.