Skip to content

Latest commit

 

History

History
46 lines (36 loc) · 3.56 KB

mssql-eng021798.md

File metadata and controls

46 lines (36 loc) · 3.56 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic ms.custom helpviewer_keywords monikerRange
MSSQL_ENG021798
MSSQL_ENG021798
MashaMSFT
mathoma
09/25/2024
sql
replication
reference
updatefrequency5
MSSQL_ENG021798 error
=azuresqldb-mi-current||>=sql-server-2016

MSSQL_ENG021798

[!INCLUDE SQL Server SQL MI]

Message Details

Attribute Value
Product Name SQL Server
Event ID 21798
Event Source MSSQLSERVER
Component [!INCLUDEssDEnoversion]
Symbolic Name
Message Text The '%s' agent job must be added through '%s' before continuing. Please see the documentation for '%s'.

Explanation

To create a publication, you must be a member of the sysadmin fixed server role on the Publisher or a member of the db_owner fixed database role in the publication database. If you are a member of the db_owner role, this error is raised if:

  • You run scripts from [!INCLUDEssVersion2000]. The security model changed in [!INCLUDEssVersion2005], and these scripts must be updated.

  • The stored procedure sp_addpublication is executed before executing sp_addlogreader_agent (Transact-SQL). This applies to all transactional publications.

  • The stored procedure sp_addpublication is executed before executing sp_addqreader_agent (Transact-SQL). This applies to transactional publications that are enabled for queued updating subscriptions (a value of TRUE for the @allow_queued_tran parameter of sp_addpublication).

The stored procedures sp_addlogreader_agent and sp_addqreader_agent each create an agent job and allow you to specify the [!INCLUDEmsCoName] Windows account under which the agent runs. For users in the sysadmin role, agent jobs are created implicitly if sp_addlogreader_agent and sp_addqreader_agent are not executed; agents run under the context of the [!INCLUDEssNoVersion] Agent service account at the Distributor. Although sp_addlogreader_agent and sp_addqreader_agent are not required for users in the sysadmin role, it is a security best practice to specify a separate account for the agents. For more information, see Replication Agent Security Model.

User Action

Ensure you execute procedures in the correct order. For more information, see Create a Publication. If you have replication scripts from previous versions of [!INCLUDEssNoVersion], update these scripts to include the stored procedures and parameters required by [!INCLUDEssVersion2005] and later versions. For more information, see Upgrade Replication Scripts (Replication Transact-SQL Programming).

Related content