Following a datacenter disaster, where the subscription database was/is lost and gone forever ("others" decided not to restore the database which was pulling the subscription), the local "master" database hosting the "publication" chugged along fine for a few weeks, me completely forgetting about the replication settings, 'till the distribution database started growing out of control. Point is, I'd just like to remove ANY reference to ANY legacy publication/replication on this database, and can't seem to do so. Database is SQL 2008 64 BIT.
First, just right-clicking on the publication name in Local Publications and selecting delete fails with:
Could notdelete publication 'FISHREP'.
An exception occurred while executing a Transact-SQL statement or batch.(Microsoft.SqlServer.ConnectionInfo)
Target string size is too small to represent the XML instance
Changed database context to'Fish'.(Microsoft SQL Server, Error:6354)
Ok...so I tried:
DECLARE@publicationDB AS sysname;DECLARE@publication AS sysname;SET@publicationDB = N'FISH';SET@publication = N'FISHREP';USE[FISH]EXEC sp_droppublication @publication =@publication;
Which fails with:
Msg 14013, Level 16, State 1,Procedure sp_MSrepl_droppublication, Line 87
This databaseisnot enabled for publication.
Ok....so next:
EXEC sp_replicationdboption @dbname =@publicationDB,@optname = N'publish',@value = N'true';
GO
Then
EXEC sp_droppublication @publication =@publication;
Which gives a DIFFERENT ERROR
Msg 20026, Level 11, State 1,Procedure sp_MSrepl_droppublication, Line 146
The publication 'FISHREP' does not exist.
I could go on and on with the hundreds of different permutations of SQL text I've tried to remove this !)@&^@!^!@& publication, nothing works. I can't even drop the database!
Is there some magical SQL management mode that will let me get rid of this publication?