select distinct
object_name(p.object_id),
p.partition_number,
pf.name,
ps.name,
prv.value,
p.data_compression_desc,
fg.name,
p.rows
from sys.partitions (nolock) p
inner join sys.indexes (nolock)i on p.object_id = i.object_id and p.index_id = i.index_id
inner join sys.partition_schemes ps (nolock) on ps.data_space_id=i.data_space_id
inner join sys.partition_functions (nolock)pf on pf.function_id=ps.function_id
inner join sys.partition_range_values(nolock) prv on p.partition_number = prv.boundary_id and prv.function_id=pf.function_id
inner join sys.allocation_units au ON au.container_id = p.hobt_id
inner join sys.filegroups fg ON fg.data_space_id = au.data_space_id
where pf.name='PF_Name'
and object_name(p.object_id) = 'TableName'
--and partition_number<386
--and cast(prv.value as datetime) > '2014-03-04 00:00:00.000'
order by object_name(p.object_id),p.partition_number-- desc
No comments:
Post a Comment