locked
The database is not published. Execute the procedure in a database that is published for replication. RRS feed

  • Question

  • Hi,

    I am trying to create a publication on sql server 2005 database , i got the follwong error:

     

    TITLE: New Publication Wizard
    ------------------------------

    SQL Server could not create publication 'testreplication'.

    ------------------------------
    ADDITIONAL INFORMATION:

    An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

    ------------------------------

    The 'mydb' database is not published for merge replication.
    Unable to execute procedure. The database is not published. Execute the procedure in a database that is published for replication.
    Changed database context to 'mydb'. (Microsoft SQL Server, Error: 21147)

    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.1399&EvtSrc=MSSQLServer&EvtID=21147&LinkId=20476

    ------------------------------
    BUTTONS:

    OK
    ------------------------------

     

    i checked the publichers properties, and publictation databases , the database is not registered in any type of replication.

     

    Any help please ?

    Thanks,

    Tarek Ghazali

     

     


     

    Tuesday, August 22, 2006 3:08 PM

Answers

  • Hi Greg,

    Thanks for your reply , i found the solution.

    I already created a database DDL trigger , for this reason i got this error, you need to put it disable and create publication.

    Regards,

    Tarek Ghazali

    SQL Server MVP

    Wednesday, August 23, 2006 8:05 AM

All replies

  • unfortunately this doesn't tell us what proc was being executed, so it's hard to tell exactly where it failed.  Can you try running sp_removedbreplication on the database, this will hopefully remove all bits.

    At the same time, is this a restored database that previously had replication?  i.e. did you restore the database using keep_replication setting?

    • Proposed as answer by raree Tuesday, August 20, 2013 9:37 PM
    Tuesday, August 22, 2006 3:39 PM
  • Hi Greg,

    Thanks for your reply , i found the solution.

    I already created a database DDL trigger , for this reason i got this error, you need to put it disable and create publication.

    Regards,

    Tarek Ghazali

    SQL Server MVP

    Wednesday, August 23, 2006 8:05 AM
  • As this happened to me, too, and I was looking for an advice and did not find it, and then I found a desicion, here it is, even though the initial discussion has been started a long ago... So, yes, would not it be handy to know what procedure actually caused the error. To find this, in a Publication Wizard, choose the last step not "Create Publication" but "Create Script". It will save the script, that the Wizard is trying to execute, in a query. Now, try to run this script one procedure at a time. In my case, the very first procedure failed with a very clear message: "Transaction log is full". And yes, it was enough just to truncate the transaction log of the database that I was trying to create a publication for, and all the rest went on smoothely without problems.

    Saturday, March 15, 2008 9:14 PM
  • To publish a db for replication:

     

    sp_replicationdboption @dbname = N'MyDBName', @optname = N'merge publish', @value = N'true'

    GO

    Thursday, January 13, 2011 3:39 PM