日期:2014-05-18  浏览次数:20557 次

请教高手,如何查看已有分区表的分区字段是哪个啊,请提供SQL脚本,谢谢~~在线等哦,每什么人气。。
请教高手,如何查看已有分区表的分区字段是哪个啊,请提供SQL脚本,谢谢

------解决方案--------------------
SQL code

select distinct 
object_name(a.object_id) tabname
,c.name colname
from sys.partitions a
inner join sys.index_columns b
 on a.object_id=b.object_id and a.index_id=b.index_id
inner join sys.columns c
 on b.object_id=c.object_id and b.index_column_id=c.column_id
where a.object_id=object_id('[分区表表名]')