Rajanand Ilangovan
Rajanand Ilangovan

Rajanand Ilangovan

How to enable SQL Server database for publication

SQL Server Replication

Rajanand Ilangovan's photo
Rajanand Ilangovan
·Jun 14, 2022·

1 min read

Subscribe to my newsletter and never miss my upcoming articles

Play this article

Problem:

I have configured the distributor and then trying to create a publication on the publication server using sp_addpublication stored procedures with respective parameters. I have got the below error message.

Error message:

Msg 14013, Level 16, State 1, Procedure sp_MSrepl_addpublication, Line 178 [Batch Start Line 3] This database is not enabled for publication.

image.png

Solution:

Using SSMS:

  1. Right click on the replication folder in object explorer and open publisher properties.
  2. Select "Publication Databases" and then enable transactional or/and merge replication according to your requirement. Then click OK.

image.png

Using T-SQL:

use master;
exec sp_replicationdboption @dbname = 'your_publication_db_name',
@optname = 'publish',
@value = 'true'
go

Let me know in comments if this solves your issue or not.

Impressum