分区情况
  --分区情况
SELECT  c.* ,
b.[groupname] AS '分区方案对应的文件组名称' ,
d.name '当前分区函数对应的分区方案'
FROM    sys.destination_data_spaces AS a
INNER JOIN sysfilegroups AS b ON a.[data_space_id] = b.[groupid]
INNER JOIN ( SELECT $PARTITION.Fun_TinyBlog_Id(id) AS 分区编号 ,
MIN(id) AS Min_value ,
MAX(id) AS Max_value ,
COUNT(id) AS 记录数
FROM   [dbo].[TinyBlog]
GROUP BY $PARTITION.Fun_TinyBlog_Id(id)
) AS c ON c.[分区编号] = a.[destination_id]
INNER JOIN sys.partition_schemes AS d ON a.[partition_scheme_id] = d.data_space_id
ORDER BY c.[分区编号]

  第二个视图直接把NULL值忽略了
  根据第一个视图,我们画出一个总结图

  分析一下

  总结
  结论其实很清晰,分区列不要允许NULL,如果允许列,那么我们交换分区归档数据的时候会有麻烦了,因为无法判断分区列是NULL值的那些数据行是老数据还是新数据