Rediger

Del via


sp_update_agent_profile (Transact-SQL)

Applies to: SQL Server

Updates the profile used by a replication agent. This stored procedure is executed at the Distributor on the distribution database.

Transact-SQL syntax conventions

Syntax

sp_update_agent_profile
    [ @agent_type = ] agent_type
    , [ @agent_id = ] agent_id
    , [ @profile_id = ] profile_id
[ ; ]

Arguments

[ @agent_type = ] agent_type

@agent_type is int, with no default.

The type of agent. agent_type is int, with no default, and can be one of these values.

Value Description
1 Snapshot Agent.
2 Log Reader Agent.
3 Distribution Agent.
4 Merge Agent.
9 Queue Reader Agent.

[ @agent_id = ] agent_id

The ID of the agent. @agent_id is int, with no default.

[ @profile_id = ] profile_id

The ID of the profile that the agent should use. @profile_id is int, with no default. To view a list of profiles defined for each agent, use sp_help_agent_profile. For more information about system profiles, see Replication Agent Profiles.

Return code values

0 (success) or 1 (failure).

Remarks

sp_update_agent_profile is used in all types of replication.

Permissions

Only members of the sysadmin fixed server role can execute sp_update_agent_profile.