请问,如何获得分区表的分区列名称?
如题,查了半天也没有找到相关的信息,请各位帮忙,谢谢!
[解决办法]
SELECT c.name
FROM sys.index_columns AS ic
JOIN sys.columns AS c ON ic.object_id = c.object_id
AND ic.column_id = c.column_id
WHERE ic.index_id <= 1
AND ic.partition_ordinal = 1
AND ic.object_id = OBJECT_ID('对应表名')