PhysicalPartitions 屬性
取得用於儲存資料表資料的實體資料分割。
命名空間: Microsoft.SqlServer.Management.Smo
組件: Microsoft.SqlServer.Smo (在 Microsoft.SqlServer.Smo.dll 中)
語法
'宣告
<SfcObjectAttribute(SfcContainerRelationship.ChildContainer, SfcContainerCardinality.OneToAny, GetType(PhysicalPartition))> _
Public ReadOnly Property PhysicalPartitions As PhysicalPartitionCollection
Get
'用途
Dim instance As Table
Dim value As PhysicalPartitionCollection
value = instance.PhysicalPartitions
[SfcObjectAttribute(SfcContainerRelationship.ChildContainer, SfcContainerCardinality.OneToAny, typeof(PhysicalPartition))]
public PhysicalPartitionCollection PhysicalPartitions { get; }
[SfcObjectAttribute(SfcContainerRelationship::ChildContainer, SfcContainerCardinality::OneToAny,
typeof(PhysicalPartition))]
public:
property PhysicalPartitionCollection^ PhysicalPartitions {
PhysicalPartitionCollection^ get ();
}
[<SfcObjectAttribute(SfcContainerRelationship.ChildContainer, SfcContainerCardinality.OneToAny,
typeof(PhysicalPartition))>]
member PhysicalPartitions : PhysicalPartitionCollection
function get PhysicalPartitions () : PhysicalPartitionCollection
屬性值
型別:Microsoft.SqlServer.Management.Smo. . :: . .PhysicalPartitionCollection
PhysicalPartitionCollection 值,這個值會識別用於儲存資料表資料的實體資料分割集合。
範例
The following code example enumerates through each physical partition of each table in the AdventureWorks2008R2 database and displays the partitions row count.
C#
Server srv = new Server("(local)");
Database db = srv.Databases["AdventureWorks2008R2"];
foreach (Table tb in db.Tables)
{
Foreach (PhysicalPartition pt in tb.PhysicalPartitions)
{
Console.WriteLine(pt.RowCount.ToString());
}
}
Powershell
$srv = new-Object Microsoft.SqlServer.Management.Smo.Server("(local)")
$db = New-Object Microsoft.SqlServer.Management.Smo.Database
$db = $srv.Databases.Item("AdventureWorks2008R2")
Foreach ($tb in $db.Tables)
{
Foreach ($pt in $tb.PhysicalPartitions)
{
Write-Host $pt.RowCount
}
}