DbSyncProvider.SelectTableMaxTimestampsCommand Property

Gets or sets an IDbCommand object that contains the query or stored procedure that selects the maximum timestamp from each base table or tracking table, to determine whether for each table the destination already has all of the changes from the source.

This property is not CLS-compliant.  

Namespace: Microsoft.Synchronization.Data
Assembly: Microsoft.Synchronization.Data (in microsoft.synchronization.data.dll)

Syntax

'Declaration
Public Overridable Property SelectTableMaxTimestampsCommand As IDbCommand
'Usage
Dim instance As DbSyncProvider
Dim value As IDbCommand

value = instance.SelectTableMaxTimestampsCommand

instance.SelectTableMaxTimestampsCommand = value
public virtual IDbCommand SelectTableMaxTimestampsCommand { get; set; }
public:
virtual property IDbCommand^ SelectTableMaxTimestampsCommand {
    IDbCommand^ get ();
    void set (IDbCommand^ value);
}
/** @property */
public IDbCommand get_SelectTableMaxTimestampsCommand ()

/** @property */
public void set_SelectTableMaxTimestampsCommand (IDbCommand value)
public function get SelectTableMaxTimestampsCommand () : IDbCommand

public function set SelectTableMaxTimestampsCommand (value : IDbCommand)

Property Value

An IDbCommand object that contains a query or stored procedure.

Example

The following code example creates a command for the SelectTableMaxTimestampsCommand property. In the complete code example in How to: Provision a Server Database for Collaborative Synchronization (Non-SQL Server), there are synchronization sessions in which no new changes have been made at either node. In these sessions, the call to the command that is specified for the SelectTableMaxTimestampsCommand property indicates that no data changes are available to synchronize. Therefore, the command that is specified for the SelectIncrementalChangesCommand property is not called.

SqlCommand selTableMaxTsCmd = new SqlCommand();
selTableMaxTsCmd.CommandType = CommandType.Text;
selTableMaxTsCmd.CommandText = "SELECT 'Customer' AS table_name, " +
                               "MAX(local_update_peer_timestamp) AS max_timestamp " +
                               "FROM Sync.Customer_Tracking";
sampleDbProvider.SelectTableMaxTimestampsCommand = selTableMaxTsCmd;
Dim selTableMaxTsCmd As New SqlCommand()
selTableMaxTsCmd.CommandType = CommandType.Text
selTableMaxTsCmd.CommandText = "SELECT 'Customer' AS table_name, " _
                             & "MAX(local_update_peer_timestamp) AS max_timestamp " _
                             & "FROM Sync.Customer_Tracking"
sampleDbProvider.SelectTableMaxTimestampsCommand = selTableMaxTsCmd

See Also

Reference

DbSyncProvider Class
DbSyncProvider Members
Microsoft.Synchronization.Data Namespace