How to: Delete an Article (RMO Programming)
You can delete articles programmatically by using Replication Management Objects (RMO). The RMO classes you use to delete an article depend on the type of publication to which the article belongs.
To delete an article that belongs to a snapshot or transactional publication
Create a connection to the Publisher by using the ServerConnection class.
Create an instance of the TransArticle class.
Set the Name, PublicationName, and DatabaseName properties.
Set the connection from step 1 for the ConnectionContext property.
Check the IsExistingObject property to verify that the article exists. If the value of this property is false, either the article properties in step 3 were defined incorrectly or the article does not exist.
Call the Remove method.
Close all connections.
To delete an article that belongs to a merge publication
Create a connection to the Publisher by using the ServerConnection class.
Create an instance of the MergeArticle class.
Set the Name, PublicationName, and DatabaseName properties.
Set the connection from step 1 for the ConnectionContext property.
Check the IsExistingObject property to verify that the article exists. If the value of this property is false, either the article properties in step 3 were defined incorrectly or the article does not exist.
Call the Remove method.
Close all connections.
See Also
Tasks
How to: Delete an Article (Replication Transact-SQL Programming)