次の方法で共有


Table.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 (既定値) の場合、テーブルはパーティション分割されません。

説明

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

使用例

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

C#

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

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("AdventureWorks2012")

Foreach ($tb in $db.Tables) 
{
   If ($tb.IsPartitioned -eq $TRUE)
   {
      Write-Host "The" $tb.Name "table is partitioned."
   }
}

関連項目

参照

Table クラス

Microsoft.SqlServer.Management.Smo 名前空間

その他の技術情報

テーブル

CREATE TABLE (Transact-SQL)