• Thank you for checking and using this stored procedure.

    I noticed issue 1) before and it is a very simple fix. We need to add the schema name in the dynamic script. I will also fix issue 2 and post the changes later.

    There is also another limitation: all indexes are aligned with partition.

    I agree: partition truncation should be built-in DDL operation but SQL server still does not support it.