次の方法で共有


SubscriptionClass.IndexSqlStatements Property

サブスクリプション クラスに 1 つ以上のインデックスを作成するために、Transact-SQL ステートメントのコレクションを取得します。

名前空間: Microsoft.SqlServer.Management.Nmo
アセンブリ: Microsoft.SqlServer.Smo (microsoft.sqlserver.smo.dll 内)

構文

'宣言
Public ReadOnly Property IndexSqlStatements As StringCollection
public StringCollection IndexSqlStatements { get; }
public:
property StringCollection^ IndexSqlStatements {
    StringCollection^ get ();
}
/** @property */
public StringCollection get_IndexSqlStatements ()
public function get IndexSqlStatements () : StringCollection

プロパティ値

インデックス作成用の Transact-SQL ステートメント文字列を格納する StringCollection です。

解説

インデックス ステートメントは、オプションです。

ステートメントのコレクションを変更するには、StringCollection メソッドを使用します。

インデックス ステートメントを変更した後、アプリケーションを更新すると、対応するサブスクリプション クラスが再作成されます。Notification Services は、既存のサブスクリプション テーブルの名前に "Old" を追加して名前を変更してから、新しいテーブルを作成します。以前のサブスクリプション テーブルのインデックスは、変更されずに残されます。

以前のサブスクリプション テーブルから新しいサブスクリプション テーブルにデータを転送するには、手動で転送する必要があります。詳細については、「アプリケーションの更新」を参照してください。

使用例

次の例は、サブスクリプション クラスにインデックスを定義する方法を示しています。

// Add an index to the subscription class.
flightSubscriptions.IndexSqlStatements.Add(
    "CREATE INDEX FlightSubscriptionsIndex ON " + 
    "MyAppSchema.FlightSubscriptions ( LeavingFrom, GoingTo )");
' Add an index to the subscription class to help improve performance
flightSubscriptions.IndexSqlStatements.Add( _
    "CREATE INDEX FlightSubscriptionsIndex ON " + _
    "MyAppSchema.FlightSubscriptions ( LeavingFrom, GoingTo )")

スレッド セーフ

この型の public static (Microsoft Visual Basic では共有 ) メンバは、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。

プラットフォーム

開発プラットフォーム

サポートされているプラットフォームの一覧については、「SQL Server 2005 のインストールに必要なハードウェアおよびソフトウェア」を参照してください。

対象プラットフォーム

サポートされているプラットフォームの一覧については、「SQL Server 2005 のインストールに必要なハードウェアおよびソフトウェア」を参照してください。

参照

関連項目

SubscriptionClass Class
SubscriptionClass Members
Microsoft.SqlServer.Management.Nmo Namespace

その他の技術情報

サブスクリプション クラスのインデックスの定義
SubscriptionClass の IndexSqlSchema 要素 (ADF)