Skip to content

Latest commit

 

History

History
86 lines (63 loc) · 3.41 KB

sp-add-agent-parameter-transact-sql.md

File metadata and controls

86 lines (63 loc) · 3.41 KB
title description author ms.author ms.reviewer ms.date ms.service ms.subservice ms.topic f1_keywords helpviewer_keywords dev_langs
sp_add_agent_parameter (Transact-SQL)
sp_add_agent_parameter (Transact-SQL)
mashamsft
mathoma
randolphwest
12/28/2023
sql
replication
reference
sp_add_agent_parameter_TSQL
sp_add_agent_parameter
sp_add_agent_parameter
TSQL

sp_add_agent_parameter (Transact-SQL)

[!INCLUDE SQL Server SQL MI]

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

:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions

Syntax

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

Arguments

[ @profile_id = ] profile_id

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:

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

[ @parameter_name = ] 'parameter_name'

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'

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

Return code values

0 (success) or 1 (failure).

Remarks

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

Permissions

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

Related content