Skip to content

Latest commit

 

History

History
48 lines (37 loc) · 3.71 KB

File metadata and controls

48 lines (37 loc) · 3.71 KB
title MSSQL_ENG021798 | Microsoft Docs
ms.custom
ms.date 03/14/2017
ms.prod sql
ms.prod_service database-engine
ms.reviewer
ms.technology replication
ms.topic conceptual
helpviewer_keywords
MSSQL_ENG021798 error
ms.assetid 596f5092-75ab-4a19-8582-588687c7b089
author MashaMSFT
ms.author mathoma
monikerRange =azuresqldb-mi-current||>=sql-server-2016||=sqlallproducts-allversions

MSSQL_ENG021798

[!INCLUDEappliesto-ss-asdbmi-xxxx-xxx-md]

Message Details

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).

See Also

Errors and Events Reference (Replication)