sp_stop_rep_agent

Description

Shuts down the RepAgent thread for the specified database.

Syntax

sp_stop_rep_agent dbname[, 'nowait']

Parameters

dbname

The name of the database for which you want to shut down the RepAgent.

nowait

Shuts down the RepAgent immediately, without waiting for executing operations to complete.

The default shuts down RepAgent gracefully at the end of the current batch.

Examples

Example 1

Shuts down an integrated RepAgent for the pubs2 database. The default shutdown option allows RepAgent to finish processing the current batch.

sp_stop_rep_agent pubs2 

Usage

Permissions

sp_start_rep_agent requires “sa” or “dbo” permission or replication_role.

See also

sp_config_rep_agent, sp_help_rep_agent, sp_start_rep_agent