次の方法で共有


IsPartitioned プロパティ

テーブルがパーティション分割されるかどうかを示す Boolean プロパティ値を取得します。

名前空間:  Microsoft.SqlServer.Management.Smo
アセンブリ:  Microsoft.SqlServer.Smo (Microsoft.SqlServer.Smo.dll)

構文

'宣言
<SfcPropertyAttribute(SfcPropertyFlags.Standalone)> _
Public ReadOnly Property IsPartitioned As Boolean
    Get
'使用
Dim instance As Table
Dim value As Boolean

value = instance.IsPartitioned
[SfcPropertyAttribute(SfcPropertyFlags.Standalone)]
public bool IsPartitioned { get; }
[SfcPropertyAttribute(SfcPropertyFlags::Standalone)]
public:
property bool IsPartitioned {
    bool get ();
}
[<SfcPropertyAttribute(SfcPropertyFlags.Standalone)>]
member IsPartitioned : bool
function get IsPartitioned () : boolean

プロパティ値

型: System. . :: . .Boolean
テーブルがパーティション分割されるかどうかを示す Boolean 値。
True の場合、テーブルはパーティション分割されます。False (既定値) の場合、テーブルはパーティション分割されません。

説明

パーティション分割は、パフォーマンスを向上させるために使用されます。

使用例

次のコード例では、AdventureWorks2008R2 データベース内でパーティション分割されているテーブルをすべて一覧表示する方法を示します。

C#

Server srv = new Server("(local)");
Database db = srv.Databases["AdventureWorks2008R2"];

foreach (Table tb in db.Tables) 
{
   if (tb.IsPartitioned == True)
   {
      Console.WriteLine("The " + tb.Name + " table is paritioned.");
   }
}

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) 
{
   If ($tb.IsPartitioned -eq $TRUE)
   {
      Write-Host "The" $tb.Name "table is partitioned."
   }
}