Share via

DbSyncTableDescription Class

Represents the schema of a table that is included in the Tables list of a DbSyncScopeDescription object. This is used during database provisioning.

Namespace: Microsoft.Synchronization.Data
Assembly: Microsoft.Synchronization.Data (in


<SerializableAttribute> _
Public Class DbSyncTableDescription
Dim instance As DbSyncTableDescription
public class DbSyncTableDescription
public ref class DbSyncTableDescription
/** @attribute SerializableAttribute() */ 
public class DbSyncTableDescription
public class DbSyncTableDescription


The following code example describes a scope named filtered_customer, and adds three tables to the scope: Customer, CustomerContact, and NewTable. The first two tables already exist in the server database, so the GetDescriptionForTable method is used to retrieve the schema from the server database. All columns from the Customer table are included, but only two columns from the CustomerContact table are included. The NewTable table is defined by using DbSyncTableDescription and DbSyncColumnDescription objects, and then the table is created in the server database (and in the other databases that synchronize with it). To view this code in the context of a complete example, see How to: Configure and Execute Collaborative Synchronization (SQL Server).

DbSyncTableDescription newTableDescription = new DbSyncTableDescription("Sales.NewTable");

DbSyncColumnDescription newTableIdCol = new DbSyncColumnDescription();
DbSyncColumnDescription newTableContentCol = new DbSyncColumnDescription();

newTableIdCol.UnquotedName = "NewTableId";
newTableIdCol.Type = "int";
newTableIdCol.IsPrimaryKey = true;

newTableContentCol.UnquotedName = "NewTableContent";
newTableContentCol.Type = "nvarchar";
newTableContentCol.Size = "100";
newTableContentCol.IsPrimaryKey = false;

Dim newTableDescription As New DbSyncTableDescription("Sales.NewTable")

Dim newTableIdCol As New DbSyncColumnDescription()
Dim newTableContentCol As New DbSyncColumnDescription()

newTableIdCol.UnquotedName = "NewTableId" 
newTableIdCol.Type = "int" 
newTableIdCol.IsPrimaryKey = True 

newTableContentCol.UnquotedName = "NewTableContent" 
newTableContentCol.Type = "nvarchar" 
newTableContentCol.Size = "100" 
newTableContentCol.IsPrimaryKey = False 


Inheritance Hierarchy


Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also


DbSyncTableDescription Members
Microsoft.Synchronization.Data Namespace