DbSyncProvider.UpdateScopeInfoCommand Property
Gets or sets an IDbCommand object that contains the query or stored procedure that updates scope metadata in the peer database.
This property is not CLS-compliant.
Namespace: Microsoft.Synchronization.Data
Assembly: Microsoft.Synchronization.Data (in microsoft.synchronization.data.dll)
Syntax
'Declaration
Public Property UpdateScopeInfoCommand As IDbCommand
'Usage
Dim instance As DbSyncProvider
Dim value As IDbCommand
value = instance.UpdateScopeInfoCommand
instance.UpdateScopeInfoCommand = value
public IDbCommand UpdateScopeInfoCommand { get; set; }
public:
property IDbCommand^ UpdateScopeInfoCommand {
IDbCommand^ get ();
void set (IDbCommand^ value);
}
/** @property */
public IDbCommand get_UpdateScopeInfoCommand ()
/** @property */
public void set_UpdateScopeInfoCommand (IDbCommand value)
public function get UpdateScopeInfoCommand () : IDbCommand
public function set UpdateScopeInfoCommand (value : IDbCommand)
Property Value
An IDbCommand object that contains a query or stored procedure.
Remarks
This command updates information from the scope metadata table, such as the synchronization knowledge and cleanup knowledge that Sync Services requires. For more information about how scope is used, see "Creating Tracking Tables to Store Metadata" in How to: Configure Change Tracking and Synchronize Peers.
Example
The following code example specifies the command that updates metadata in the scope table in each peer database. To view this code in the context of a complete example, see How to: Configure Change Tracking and Synchronize Peers.
SqlCommand updReplicaInfoCmd = new SqlCommand();
updReplicaInfoCmd.CommandType = CommandType.Text;
updReplicaInfoCmd.CommandText = "UPDATE Sales.ScopeInfo SET " +
"scope_sync_knowledge = @" + DbSyncSession.SyncScopeKnowledge + ", " +
"scope_tombstone_cleanup_knowledge = @" + DbSyncSession.SyncScopeCleanupKnowledge + " " +
"WHERE scope_name = @" + DbSyncSession.SyncScopeName + " AND " +
" ( @" + DbSyncSession.SyncCheckConcurrency + " = 0 or scope_timestamp = @" + DbSyncSession.SyncScopeTimestamp + "); " +
"SET @" + DbSyncSession.SyncRowCount + " = @@rowcount";
updReplicaInfoCmd.Parameters.Add("@" + DbSyncSession.SyncScopeKnowledge, SqlDbType.VarBinary, 10000);
updReplicaInfoCmd.Parameters.Add("@" + DbSyncSession.SyncScopeCleanupKnowledge, SqlDbType.VarBinary, 10000);
updReplicaInfoCmd.Parameters.Add("@" + DbSyncSession.SyncScopeName, SqlDbType.NVarChar, 100);
updReplicaInfoCmd.Parameters.Add("@" + DbSyncSession.SyncCheckConcurrency, SqlDbType.Int);
updReplicaInfoCmd.Parameters.Add("@" + DbSyncSession.SyncScopeTimestamp, SqlDbType.BigInt);
updReplicaInfoCmd.Parameters.Add("@" + DbSyncSession.SyncRowCount, SqlDbType.Int).Direction = ParameterDirection.Output;
peerProvider.UpdateScopeInfoCommand = updReplicaInfoCmd;
Dim updReplicaInfoCmd As New SqlCommand()
With updReplicaInfoCmd
.CommandType = CommandType.Text
.CommandText = "UPDATE Sales.ScopeInfo SET " _
& "scope_sync_knowledge = @" + DbSyncSession.SyncScopeKnowledge + ", " _
& "scope_tombstone_cleanup_knowledge = @" + DbSyncSession.SyncScopeCleanupKnowledge + " " _
& "WHERE scope_name = @" + DbSyncSession.SyncScopeName + " AND " _
& " ( @" + DbSyncSession.SyncCheckConcurrency + " = 0 or scope_timestamp = @" + DbSyncSession.SyncScopeTimestamp + "); " _
& "SET @" + DbSyncSession.SyncRowCount + " = @@rowcount"
.Parameters.Add("@" + DbSyncSession.SyncScopeKnowledge, SqlDbType.VarBinary, 10000)
.Parameters.Add("@" + DbSyncSession.SyncScopeCleanupKnowledge, SqlDbType.VarBinary, 10000)
.Parameters.Add("@" + DbSyncSession.SyncScopeName, SqlDbType.NVarChar, 100)
.Parameters.Add("@" + DbSyncSession.SyncCheckConcurrency, SqlDbType.Int)
.Parameters.Add("@" + DbSyncSession.SyncScopeTimestamp, SqlDbType.BigInt)
.Parameters.Add("@" + DbSyncSession.SyncRowCount, SqlDbType.Int).Direction = ParameterDirection.Output
End With
peerProvider.UpdateScopeInfoCommand = updReplicaInfoCmd
See Also
Reference
DbSyncProvider Class
DbSyncProvider Members
Microsoft.Synchronization.Data Namespace