How do I list the tables associated with a particular partition scheme? Basically I need to join between sys.tables and sys.data_spaces. The sys.tables view has a field for lob_data_space_id, but this seems to apply to the large object fields.
-Darrell
select ps.name as SchemaName, obj.name as TableName from sys.partition_schemes ps
join sys.indexes idx on (ps.data_space_id=idx.data_space_id)
join sys.objects obj on (idx.object_id=obj.object_id)
|||This tells me which indexes are partitioned on the partition scheme, but not exactly the tables. This only works for tables if you assume that each table has at least one index created on the same partition scheme as the table itself. I want to be able to deal with the scenario where the table may not have any indexes create on the same partition as the base table.
The partitioned table may have no indexes or it may have indexes that are partitioned on a different scheme.
-Darrell
No comments:
Post a Comment