[英]ALTER TABLE SWITCH statement failed. Range defined by partition 1 in table is not a subset of range
I am getting this error whenever I am trying to switch the partition from staging to warehouse table. 每当我尝试将分区从暂存表切换到仓库表时,都会出现此错误。
ALTER TABLE SWITCH statement failed. ALTER TABLE SWITCH语句失败。 Range defined by partition 1 in table 'dbo.table1' is not a subset of range defined by partition 299 in table 'dbo.table2'
表'dbo.table1'中分区1定义的范围不是表'dbo.table2'中分区299定义的范围的子集
Please let me know the workaround to this error if anyone have gone through the same error in the past. 如果过去有人遇到过相同的错误,请告诉我该错误的解决方法。
Try this, Dissolve the last range 试试这个,溶解最后的范围
ALTER PARTITION FUNCTION <functname> MERGE RANGE (<range_of_299>)
Re-create 重新建立
ALTER PARTITION FUNCTION <functname> SPLIT RANGE (<increased_range_of_299>)
Then try SWITCH.Let me know after you tried 然后尝试SWITCH。尝试后让我知道
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.