BUG: Drop Table on Referencing Table After Restarting Server Fails (236308)



The information in this article applies to:

  • Microsoft SQL Server 6.5 Service Pack 2 and later

This article was previously published under Q236308
BUG #: 18654 (SQLBUG_65)

SYMPTOMS

After unpublishing a database that contains tables previously published, subsequent Drop Table commands fail with the following error:
Error: Msg 3724, Level 16, State 1
Cannot drop the table 'dbo.table_name' because it is published for replication.
This problem occurs only if SQL Server has been restarted prior to unpublishing and dropping the tables.

WORKAROUND

Run sp_MSunpublish_db against the database.

STATUS

Microsoft has confirmed this to be a problem in SQL Server 6.5.

MORE INFORMATION

If a set of tables have Foreign Key Constraints and were previously published, dropping the referencing tables using the Drop Table command incorrectly sets the published bit in sysobjects.category for the referenced table. This causes the Drop Table command on the referenced tables to fail with the above error.

Sp_MSunpublish_db can be obtained from ftp://ftp.microsoft.com/Softlib/MSLFiles/Sqlunpub.exe.

Modification Type:MajorLast Reviewed:10/3/2003
Keywords:kbbug kbpending KB236308