您不应该丢失数据合并分区。不过,请创建一个备份,以防万一。
这是一个查询,可以让您深入了解哪些表正在使用分区函数:
DECLARE @PartitionFunction sysname = 'YourPartitionFunctionName';
SELECT t.name TableName
, pf.name PartitionFunction
, ps.name PartitionScheme
, pst.partition_number
, pst.used_page_count
, row_count
from sys.dm_db_partition_stats pst
JOIN sys.partitions p ON pst.partition_id = p.partition_id
JOIN sys.tables t
ON p.object_id = t.object_id
JOIN sys.indexes i
ON p.object_id = i.object_id
AND p.index_id = i.index_id
JOIN sys.allocation_units au
ON p.hobt_id = au.container_id
JOIN sys.filegroups f
ON au.data_space_id = f.data_space_id
JOIN sys.partition_schemes ps
ON ps.data_space_id = i.data_space_id
JOIN sys.partition_functions pf
ON ps.function_id = pf.function_id
WHERE used_page_count > 0
AND pf.name = @PartitionFunction
AND pst.index_id IN (0,1)/*Remove Nonclustered index counts*/;
您还可以在此处参考我的答案,了解我经常用于监视分区卷的表值函数。