Skip to content

Latest commit

 

History

History
38 lines (30 loc) · 1.86 KB

enable-a-database-for-replication-sql-server-management-studio.md

File metadata and controls

38 lines (30 loc) · 1.86 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic ms.custom helpviewer_keywords monikerRange
Enable a database for Replication (SSMS)
Learn how to enable a database for Replication using SQL Server Management Studio (SSMS) or Transact-SQL (T-SQL).
MashaMSFT
mathoma
03/01/2017
sql
replication
ui-reference
updatefrequency5
databases [SQL Server replication]
=azuresqldb-mi-current||>=sql-server-2016

Enable a Database for Replication (SQL Server Management Studio)

[!INCLUDE SQL Server SQL MI]

A database is implicitly enabled for replication when a member of the sysadmin fixed server role creates a publication with the New Publication Wizard. A member of the sysadmin fixed server role can also enable a database for replication explicitly, so that a member of the db_owner fixed database role can create one or more publications in that database. To enable a database explicitly, use the Publication Databases page of the Publisher Properties - <Publisher> dialog box. For more information about accessing this dialog box, see Create a Publication.

Using SQL Server Management Studio (SSMS)

  1. On the Publication Databases page of the Publisher Properties - <Publisher> dialog box, select the Transactional and/or Merge check box for each database you want to replicate. Select Transactional to enable the database for snapshot replication.

  2. Select OK.

Using Transact-SQL (T-SQL)

You can enable a database for replication with the following Transact-SQL code:

USE master
EXEC sp_replicationdboption @dbname = 'AdventureWorks2022',
@optname = 'publish',
@value = 'true'
GO

To disable publishing, set the @value = 'false'.