The RMO classes that you use to remove a publication depend on the type of publication you remove. You can delete publications programmatically by using Replication Management Objects (RMO). Using Replication Management Objects (RMO) DECLARE AS sysnameĮXEC sp_dropmergepublication = Remove replication objects from the database. For more information, see Delete a Pull Subscription or Delete a Push Subscription. This example assumes that all subscriptions were previously removed.
#DELETE PUBLICATION FROM ISSUU HOW TO#
This example shows how to remove a merge publication and disable merge publishing for a database. DECLARE AS sysname ĮXEC sp_droppublication = Remove replication objects from the database. This example shows how to remove a transactional publication and disable transactional publishing for a database. (Optional) At the Subscriber on the subscription database, execute sp_mergesubscription_cleanup (Transact-SQL) to remove any remaining replication metadata in the subscription database. (Optional) If this database has no other publications, execute sp_replicationdboption (Transact-SQL) to disable publication of the current database using merge replication. Specify a value of merge for (Optional) If the Distributor cannot be accessed or if the status of the database is suspect or offline, specify a value of 1 for (Optional) Specify the name of the database for if sp_removedbreplication is not executed on the publication database. To delete all publications in and remove all replication objects from a published database, execute sp_removedbreplication at the Publisher. To delete a single publication, execute sp_dropmergepublication (Transact-SQL) at the Publisher on the publication database. (Optional) At the Subscriber on the subscription database, execute sp_subscription_cleanup to remove any remaining replication metadata in the subscription database. (Optional) If this database has no other publications, execute sp_replicationdboption (Transact-SQL) to disable publication of the current database using snapshot or transactional replication. Specifying a value of 1 for may leave replication-related publishing objects in the database. The stored procedures that you use depend on the type of publication being deleted. Publications can be deleted programmatically using replication stored procedures. Right-click the publication you want to delete, and then click Delete. To delete a publicationĬonnect to the Publisher in Management Studio, and then expand the server node.Įxpand the Replication folder, and then expand the Local Publications folder. This topic describes how to delete a publication in SQL Server by using SQL Server Management Studio, Transact-SQL, or Replication Management Objects (RMO).ĭelete publications from the Local Publications folder in SQL Server Management Studio. Applies to: SQL Server (all supported versions) Azure SQL Managed Instance