none
how to delete a not existing publication? RRS feed

  • Frage

  • hi everybody,

     

    i'm sittin here for hours and don't understand whats goin on??

    we have a database which uses a replication. for some reasons i had to delete the DB and restore it from a backup. usually u can't delete a DB when its used for a replication. but i didn't get any error message concerning that, and the DB was deleted. so i restore the DB and want to delete it for some reasons again and then THE CRASH!!! the database cant be deleted because its used for a repl. the publication entry is under replications>publications. i cant delete the publication, because it doesnt exist !!!

    "The publication 'xxx' does not exist (MSSQL Server, Error : 20026).

     

    whats goin on here? u cant delete the DB because of the publication on it, u cant delete the publication because it doesnt exist, but the entry is there!!!

     

    please help me!

    Montag, 26. Juli 2010 12:21

Antworten

  • this was the solution in my case :

     

    exec sp_dboption 'InstrumentDatabase', 'published',true exec sp_dboption 'InstrumentDatabase', 'subscribed',true
    
    --exec sp_droppublication @publication='InstrumentDatabase_Publication', @ignore_distributor = 1 --exec sp_dboption 'InstrumentDatabase'
    
    DECLARE @publication AS sysname
    DECLARE @publicationDB  AS sysname
    SET @publication = N'InstrumentDatabase_Publication' 
    SET @publicationDB = N'InstrumentDatabase'
    
    -- Remove the merge publication.
    USE [InstrumentDatabase]
    EXEC sp_dropmergepublication @publication = @publication;
    
    -- Remove replication objects from the database.
    USE [master]
    EXEC sp_replicationdboption
     @dbname = @publicationDB,
     @optname = N'merge publish',
     @value = N'false'
    GO
    
    

    Montag, 26. Juli 2010 15:12

Alle Antworten

  • Hallo AV1406,

    Schau Dir die folgende Diskussion an. Vielleicht findest Du etwas dass Dir weiter helfen kann.

    Cannot delete a publication in SQL server 2005: The publication does not exist [SQL server error: 20026]

    Grüße,

    Robert

    Montag, 26. Juli 2010 14:41
    Moderator
  • this was the solution in my case :

     

    exec sp_dboption 'InstrumentDatabase', 'published',true exec sp_dboption 'InstrumentDatabase', 'subscribed',true
    
    --exec sp_droppublication @publication='InstrumentDatabase_Publication', @ignore_distributor = 1 --exec sp_dboption 'InstrumentDatabase'
    
    DECLARE @publication AS sysname
    DECLARE @publicationDB  AS sysname
    SET @publication = N'InstrumentDatabase_Publication' 
    SET @publicationDB = N'InstrumentDatabase'
    
    -- Remove the merge publication.
    USE [InstrumentDatabase]
    EXEC sp_dropmergepublication @publication = @publication;
    
    -- Remove replication objects from the database.
    USE [master]
    EXEC sp_replicationdboption
     @dbname = @publicationDB,
     @optname = N'merge publish',
     @value = N'false'
    GO
    
    

    Montag, 26. Juli 2010 15:12