The UpdateAgentProfile method alters a profile setting for the agent specified.
object.UpdateAgentProfile(
DistributionDB , AgentType , AgentID , ConfigurationID )
| Part | Description |
|---|---|
| object | Expression that evaluates to an object in the Applies To list |
| DistributionDB | String |
| AgentType | Long integer specifying a replication agent type as described in Settings |
| AgentID | Long integer |
| ConfigurationID | Long integer |
Set the AgentType argument by using these values.
| Constant | Value | Description |
|---|---|---|
| SQLDMOReplAgent_All | 0 | All replication agent types |
| SQLDMOReplAgent_Default | 0 | SQLDMOReplAgent_All |
| SQLDMOReplAgent_Distribution | 3 | Replication Distribution Agent |
| SQLDMOReplAgent_LogReader | 2 | Replication transaction log monitoring agent |
| SQLDMOReplAgent_Merge | 4 | Replication Merge Agent |
| SQLDMOReplAgent_Miscellaneous | 5 | Agents not otherwise classified |
| SQLDMOReplAgent_Publishers | -1 | Agents supporting Publishers |
| SQLDMOReplAgent_Snapshot | 1 | Replication Snapshot Agent |
Changing a replication agent profile setting by using the UpdateAgentProfile method requires appropriate privilege. The SQL Server login used for SQLServer object connection must be a member of the fixed role sysadmin.
HRESULT UpdateAgentProfile(
SQLDMO_LPCSTR DistributionDBName,
SQLDMO_REPLAGENT_TYPE AgentType,
long lAgentID,
long lConfigurationID);