次の方法で共有


Table.IsIndexable プロパティ

インデックスをテーブルに配置できるかどうかを示す Boolean プロパティ値を取得します。

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

構文

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

value = instance.IsIndexable
[SfcPropertyAttribute(SfcPropertyFlags.None|SfcPropertyFlags.Standalone|SfcPropertyFlags.SqlAzureDatabase)]
public bool IsIndexable { get; }
[SfcPropertyAttribute(SfcPropertyFlags::None|SfcPropertyFlags::Standalone|SfcPropertyFlags::SqlAzureDatabase)]
public:
property bool IsIndexable {
    bool get ();
}
[<SfcPropertyAttribute(SfcPropertyFlags.None|SfcPropertyFlags.Standalone|SfcPropertyFlags.SqlAzureDatabase)>]
member IsIndexable : bool
function get IsIndexable () : 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.IsIndexable == True)
   {
      Console.WriteLine("The " + tb.Name + " table is indexable.");
   }
}

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.IsIndexable -eq $TRUE)
   {
      Write-Host "The" $tb.Name "table is indexable."
   }
}

関連項目

参照

Table クラス

Microsoft.SqlServer.Management.Smo 名前空間

その他の技術情報

テーブル

CREATE TABLE (Transact-SQL)