How to configure replication? - This database is not enabled for publication
I'm trying to configure replication on SQL Server 2005. I can do it using wizard. But when I'm trying to run generated scripts by this wizard the error message appears:
Msg 14013, Level 16, State 1, Procedure sp_MSrepl_addpublication, Line 159
This database is not enabled for publication.
Msg 18757, Level 16, State 1, Procedure sp_MSrepl_addpublication_snapshot, Line 66
Unable to execute procedure. The database is not published. Execute the procedure in a database that is published for replication.
Msg 14013, Level 16, State 1, Procedure sp_MSrepl_addarticle, Li开发者_开发技巧ne 168
This database is not enabled for publication.
Msg 14294, Level 16, State 1, Procedure sp_verify_job_identifiers, Line 25
Supply either @job_id or @job_name to identify the job.
It's a bit strange, because when I'm running this query on database where I clicked and then removed publication, everyting is going well. The problem is when I'm using my query on new database. What is more I'm using sp_replicationdboption stored procedure. When I'm tryin to run it, it says:
The replication option publish
of database ReplicationTest00
has already been set to true.
Please help me resolve this issue.
I assume you have configured the Distributor for your Replication topology?
My advice with regards to Replication, do NOT execute your steps via the Wizard.
By all means, use the wizard to create your configuration options but rather than execute at then end, script out the steps. This way you have a full record of your configuration in T-SQL form and you manually make amendments/tweaks to the code presented.
Ok I found solution for this issue. I was tring to run snapshor replication script in context of whole sql server which was producing above error message.
When I was running my script in conctext of database which is used for replication as distributor it works perfectly. :)
Before you run the script include the Use [publication_db_name]
this will set the context of the database
精彩评论