SQL Serverでは、次のクエリを使用して、パーティションテーブルのパーティション列を決定できます。
SELECT
t.name AS [Table],
c.name AS [Partitioning Column],
TYPE_NAME(c.user_type_id) AS [Column Type],
ps.name AS [Partition Scheme]
FROM sys.tables AS t
JOIN sys.indexes AS i
ON t.[object_id] = i.[object_id]
AND i.[type] <= 1
JOIN sys.partition_schemes AS ps
ON ps.data_space_id = i.data_space_id
JOIN sys.index_columns AS ic
ON ic.[object_id] = i.[object_id]
AND ic.index_id = i.index_id
AND ic.partition_ordinal >= 1
JOIN sys.columns AS c
ON t.[object_id] = c.[object_id]
AND ic.column_id = c.column_id
WHERE t.name = 'Movies';
結果:
+---------+-----------------------+---------------+-----------------------+ | Table | Partitioning Column | Column Type | Partition Scheme | |---------+-----------------------+---------------+-----------------------| | Movies | MovieId | int | MoviesPartitionScheme | +---------+-----------------------+---------------+-----------------------+
必ずMovies
を交換してください あなたのテーブル名で。
私の場合、パーティショニング列は MovieId そしてそのint タイプ。