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.

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

Syntax

'Declaration
Public Overridable Property SelectTableMaxTimestampsCommand As IDbCommand
    Get
    Set
'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);
}
abstract SelectTableMaxTimestampsCommand : IDbCommand with get, set
override SelectTableMaxTimestampsCommand : IDbCommand with get, set
function get SelectTableMaxTimestampsCommand () : IDbCommand
function set SelectTableMaxTimestampsCommand (value : IDbCommand)

Property Value

Type: System.Data.IDbCommand
An IDbCommand object that contains a query or stored procedure.

Examples

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
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

Microsoft.Synchronization.Data Namespace