| title | sp_droparticle (Transact-SQL) | ||
|---|---|---|---|
| description | sp_droparticle drops an article from a snapshot or transactional publication. | ||
| author | markingmyname | ||
| ms.author | maghan | ||
| ms.reviewer | randolphwest | ||
| ms.date | 06/23/2025 | ||
| ms.service | sql | ||
| ms.subservice | replication | ||
| ms.topic | reference | ||
| f1_keywords |
|
||
| helpviewer_keywords |
|
||
| dev_langs |
|
[!INCLUDE SQL Server SQL MI]
Drops an article from a snapshot or transactional publication. An article can't be removed if one or more subscriptions to it exist. This stored procedure is executed at the Publisher on the publication database.
:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions
sp_droparticle
[ @publication = ] N'publication'
, [ @article = ] N'article'
[ , [ @ignore_distributor = ] ignore_distributor ]
[ , [ @force_invalidate_snapshot = ] force_invalidate_snapshot ]
[ , [ @publisher = ] N'publisher' ]
[ , [ @from_drop_publication = ] from_drop_publication ]
[ ; ]
The name of the publication that contains the article to be dropped. @publication is sysname, with no default.
The name of the article to be dropped. @article is sysname, with no default.
[!INCLUDE ssinternalonly-md]
Acknowledges that the action taken by this stored procedure might invalidate an existing snapshot. @force_invalidate_snapshot is bit, with a default of 0.
-
0specifies that changes to the article don't cause the snapshot to be invalid. If the stored procedure detects that the change does require a new snapshot, an error occurs and no changes are made. -
1specifies that changes to the article might cause the snapshot to be invalid, and if there are existing subscriptions that would require a new snapshot, gives permission for the existing snapshot to be marked as obsolete and a new snapshot generated.
Specifies a non-[!INCLUDE ssNoVersion] Publisher. @publisher is sysname, with a default of NULL.
This parameter shouldn't be used when changing article properties on a [!INCLUDE ssNoVersion] Publisher.
[!INCLUDE ssinternalonly-md]
0 (success) or 1 (failure).
sp_droparticle is used in snapshot and transactional replication.
For horizontally filtered articles, sp_droparticle checks the type column of the article in the sysarticles table to determine whether a view or filter should also be dropped. If a view or filter was autogenerated, it's dropped with the article. If it was manually created, it isn't dropped.
Executing sp_droparticle to drop an article from a publication doesn't remove the object from the publication database or the corresponding object from the subscription database. Use DROP <object> to manually remove these objects if necessary.
:::code language="sql" source="../replication/codesnippet/tsql/sp-droparticle-transact-_1.sql":::
Only members of the sysadmin fixed server role or db_owner fixed database role can execute sp_droparticle.