sp_add_agent_parameter (Transact-SQL)
Collapse the table of content
Expand the table of content

sp_add_agent_parameter (Transact-SQL)

Applies To: SQL Server 2014, SQL Server 2016 Preview

Topic Status: Some information in this topic is preview and subject to change in future releases. Preview information describes new features or changes to existing features in Microsoft SQL Server 2016 Community Technology Preview 2 (CTP2).

Adds a new parameter and its value to an agent profile. This stored procedure is executed at the Distributor on any database.

Topic link icon Transact-SQL Syntax Conventions

sp_add_agent_parameter [ @profile_id = ] profile_id 
        , [ @parameter_name = ] 'parameter_name'  
        , [ @parameter_value = ] 'parameter_value' 

[ @profile_id= ] profile_id

Is the ID of the profile from the MSagent_profiles table in the msdb database. profile_id is int, with no default.

To find out what agent type this profile_id represents, find the profile_id in the MSagent_profiles (Transact-SQL) table, and note the agent_type field value. The values are as follows:




Snapshot Agent


Log Reader Agent


Distribution Agent


Merge Agent


Queue Reader Agent

[ @parameter_name= ] 'parameter_name'

Is the name of the parameter. parameter_name is sysname, with no default. For a list of parameters already defined in system profiles, see Replication Agent Profiles. For a complete list of valid parameters for each agent, see the following topics:

[ @parameter_value=] 'parameter_value'

Is the value to be assigned to the parameter. parameter_value is nvarchar(255), with no default.

0 (success) or 1 (failure)

sp_add_agent_parameter is used in snapshot replication, transactional replication, and merge replication.

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

Community Additions

© 2016 Microsoft