Transact-SQL 参考

sp_subscription_cleanup

当在订阅服务器上除去订阅时删除元数据。对于普通的订阅,元数据在系统表 MSreplication_subscriptions 中包括一项。对于同步事务订阅,还包括即时更新触发器。此存储过程在订阅服务器的订阅数据库上执行。

语法

sp_subscription_cleanup [ @publisher = ] 'publisher'
    , [ @publisher_db = ] 'publisher_db'
    [ , [ @publication = ] 'publication']
    [ , [ @reserved = ] 'reserved']

参数

[@publisher =] 'publisher'

是发布服务器名。publisher 的数据类型为 sysname,无默认值。

[@publisher_db =] 'publisher_db'

是发布服务器数据库名。publisher_db 的数据类型为 sysname,无默认值。

[@publication =] 'publication'

是发布名。publication 的数据类型为 sysname,默认值为 NULL。如果为 NULL,则将删除发布数据库中使用共享代理程序发布的订阅。

[@reserved =] 'reserved'

仅限内部使用。

返回代码值

0(成功)或 1(失败)

注释

sp_subscription_cleanup 用于所有类型的复制。

权限

只有 sysadmin 固定服务器角色成员或 db_owner 固定数据库角色成员才能执行 sp_subscription_cleanup

请参见

sp_expired_subscription_cleanup

sp_mergesubscription_cleanup

系统存储过程