SqlSyncDescriptionBuilder クラス

同期に関係する SQL Server データベースのスコープ情報およびテーブル情報を表します。

名前空間: Microsoft.Synchronization.Data.SqlServer
アセンブリ: Microsoft.Synchronization.Data.SqlServer (microsoft.synchronization.data.sqlserver.dll 内)

構文

'宣言
Public NotInheritable Class SqlSyncDescriptionBuilder
'使用
The members of a static class are accessed directly without an instance of the class.
public static class SqlSyncDescriptionBuilder
public ref class SqlSyncDescriptionBuilder abstract sealed
public final class SqlSyncDescriptionBuilder
public final class SqlSyncDescriptionBuilder

次のコード例では、filtered_customer という名前のスコープを記述し、このスコープに 2 つのテーブル CustomerCustomerContact を追加します。このテーブルは既にサーバー データベースに存在しています。そのため、スキーマは GetDescriptionForTable メソッドを使用して、サーバー データベースから取得します。Customer テーブルのすべての列が含まれますが、CustomerContact テーブルの列は 2 つしか含まれません。完全なコンテキスト例でこのコードを表示するには、「コラボレーション同期を構成して実行する方法 (SQL Server)」を参照してください。

DbSyncScopeDescription scopeDesc = new DbSyncScopeDescription("filtered_customer");

// Definition for Customer.
DbSyncTableDescription customerDescription =
    SqlSyncDescriptionBuilder.GetDescriptionForTable("Sales.Customer", serverConn);

scopeDesc.Tables.Add(customerDescription);

// Definition for CustomerContact, including the list of columns to include.
Collection<string> columnsToInclude = new Collection<string>();
columnsToInclude.Add("CustomerId");
columnsToInclude.Add("PhoneType");
DbSyncTableDescription customerContactDescription =
    SqlSyncDescriptionBuilder.GetDescriptionForTable("Sales.CustomerContact", columnsToInclude, serverConn);

scopeDesc.Tables.Add(customerContactDescription);
Dim scopeDesc As New DbSyncScopeDescription("filtered_customer")

' Definition for Customer. 
Dim customerDescription As DbSyncTableDescription = _
    SqlSyncDescriptionBuilder.GetDescriptionForTable("Sales.Customer", serverConn)

scopeDesc.Tables.Add(customerDescription)


' Definition for CustomerContact, including the list of columns to include. 
Dim columnsToInclude As New Collection(Of String)()
columnsToInclude.Add("CustomerId")
columnsToInclude.Add("PhoneType")
Dim customerContactDescription As DbSyncTableDescription = _
    SqlSyncDescriptionBuilder.GetDescriptionForTable("Sales.CustomerContact", columnsToInclude, serverConn)

scopeDesc.Tables.Add(customerContactDescription)

継承階層

System.Object
  Microsoft.Synchronization.Data.SqlServer.SqlSyncDescriptionBuilder

スレッド セーフ

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

参照

リファレンス

SqlSyncDescriptionBuilder メンバー
Microsoft.Synchronization.Data.SqlServer 名前空間