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

sp_addqreader_agent (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 Queue Reader agent for a given Distributor. This stored procedure is executed at the Distributor on the distribution database or at the Publisher on the publication database.

Topic link icon Transact-SQL Syntax Conventions

sp_addqreader_agent [ @job_login = ] 'job_login' 
        , [ @job_password = ] 'job_password'
    [ , [ @job_name = ] 'job_name'
    [ , [ @frompublisher = ] frompublisher

[ @job_login= ] 'job_login'

Is the login for the Microsoft Windows account under which the agent runs. job_login is nvarchar(257), with no default. This Windows account is always used for agent connections to the Distributor.

[ @job_password= ] 'job_password'

Is the password for the Windows account under which the agent runs. job_password is sysname, with no default.

Security note Security Note

Do not store authentication information in script files. For best security, login names and passwords should be supplied at runtime.

[ @job_name= ] 'job_name'

Is the name of an existing agent job. job_name is sysname, with a default value of NULL. This parameter is only specified when the agent is created using an existing job instead of a newly created job (the default).

[ @frompublisher= ] frompublisher

Specifies whether the procedure is being executed at the Publisher. frompublisher is bit, with a default value of 0. A value of 1 means that the procedure is being executed from the Publisher on the publication database.

0 (success) or 1 (failure)

sp_addqreader_agent is used in transactional replication.

sp_addqreader_agent must be executed at least once at a Distributor that supports queued updating after sp_adddistributiondb but before sp_addpublication.

The Queue Reader Agent job is removed when you execute sp_dropdistributiondb.

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

Community Additions

© 2016 Microsoft