Home  >  Article  >  Database  >  用TSQL从sqlserve 发布订阅链中删除一张或几张表

用TSQL从sqlserve 发布订阅链中删除一张或几张表

WBOY
WBOYOriginal
2016-06-07 17:42:491354browse

一个简单的存储过程,用来实现从一个SQLSERVE 发布订阅链中删除一张或几张表。 /*1.停日志读取代理2.exec usp_从复制订阅中删除表 'dbtestPub','test1'3.开日志读取代理author:51ak date: 20130509分发库所在服务器执行*/create proc usp_从复制订阅中删除表

一个简单的存储过程,香港空间,香港服务器,用来实现从一个SQLSERVE 发布订阅链中删除一张或几张表。

 

 

/* 1.停日志读取代理 2.exec usp_从复制订阅中删除表 'dbtestPub','test1' 3.开日志读取代理 author:51ak date: 20130509 分发库所在服务器执行 */ create proc usp_从复制订阅中删除表(@发布名 varchar(255),@表名 varchar(255)) as declare @sql varchar(8000) set @sql=' EXEC sp_dropsubscription @publication = N'''+@发布名+''', @article = N'''+@表名+''', @subscriber = N''all''; EXEC sp_droparticle @publication = N'''+@发布名+''', @article = N'''+@表名+''', @force_invalidate_snapshot = 1' print @sql exec(@sql) go ,虚拟主机

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn