SQL 2005 SP4 and MSreplication_subscriptions

If you're trying to apply SQL 2005 SP4 (or any SQL service pack), and it's failing, and you're seeing error "MSP Error:  29537  SQL Server Setup has encountered the following problem: [Microsoft][SQL Native Client][SQL Server]Invalid object name 'MSreplication_subscriptions'", then you've hit this bug which Microsoft is currently saying they "Won't Fix":

https://connect.microsoft.com/SQLServer/feedback/details/521231/failure-during-server-script-upgrade-process-on-database-in-sp-vupgrade-replication-procedure#tabs

Probably you've done one of 2 things:

  • You're using synonyms that match the system replication table names

  • You've got some vestige replication tables laying around in one of your old databases


My case was the latter. The fix was to find the vestige tables and get rid of them. I found them using the following script:
[sourcecode language="sql"]
/*
This will detect db's containing vestiges of Replication that may confuse the 2005 SP4 upgrade script.

created 20120319 by wills
*/

exec sp_MSForEachDB '
if exists(SELECT * FROM [?].sys.objects WHERE name = ''MSreplication_subscriptions'')
print ''?'' + '' - YES on MSreplication_subscriptions!'''

exec sp_MSForEachDB '
if exists(SELECT * FROM [?].sys.objects WHERE name = ''MSsubscription_agents'')
print ''?'' + '' - YES on MSsubscription_agents!'''
[/sourcecode]
If you get a hit on one of these tables but not the other, then your service pack is going to fail.

 

Comments

Popular posts from this blog

Hiding an ASPXGridView Delete button with HTMLRowCreated vs. CommandButtonInitialize

SQL Server Deadlocks - Easy Quick Start Guide