I am trying to set up transaction replication on a database. I use the following script to do so:
USE [Archive_MRPa_801]
GO
EXEC sp_replicationdboption @dbname = N'Archive_MRPa_801', @optname = N'publish',
@value = N'true'
GO
USE [Archive_MRPa_801]
GO
EXEC [Archive_MRPa].sys.sp_addlogreader_agent @job_login = N'vrc\S_PSSJ_DWDBN01',
@job_password = '*****', @publisher_security_mode = 1, @job_name = NULL
GO
When I run the first script, it succeeds. When I run the second script I get the following error:
Msg 14013, Level 16, State 1, Procedure sp_MSrepl_addlogreader_agent, Line 38
This database is not enabled for publication.
I am doing the same thing on 2 other databases and these two scripts succeed on them. I am wondering what the error is talking about, not just the solution. Also, the other two databases have a Master Key and this one does not. So, I chose to give a '0' (zero) to the @publisher_security_mode
parameter. This gave me the same result as with a '1' (one). I look forward to any responses on this.