This stored procedure is executed at the Publisher on the publication database or at the Subscriber on the subscription database. The procedure removes all replication objects from the database in which it is executed, but it does not remove objects from other databases, such as the distribution database.
This procedure should be used only if other methods of removing replication objects have failed. For more information about these methods, see Removing Replication.
-- Remove replication objects from the subscription database on MYSUB.
DECLARE @subscriptionDB AS sysname
SET @subscriptionDB = N'AdventureWorks2008R2Replica'
-- Remove replication objects from a subscription database (if necessary).
EXEC sp_removedbreplication @subscriptionDB