我有一个 SQL Server,它配置了大约 100 个订阅数据库的合并复制。
我希望能够使用 TSQL 对来自发布者的所有订阅者强制进行临时同步。
我在 TechNet 上发现了一些调用可执行文件的代码,但出于安全原因等,我希望避免这种情况。
有没有办法做到这一点?
REM -- Declare the variables.
SET Publisher=%instancename%
SET Subscriber=%instancename%
SET PublicationDB=AdventureWorks2008R2
SET SubscriptionDB=AdventureWorks2008R2Replica
SET Publication=AdvWorksProductsTran
REM -- Start the Distribution Agent with four subscription streams.
REM -- The following command must be supplied without line breaks.
"C:\Program Files\Microsoft SQL Server\100\COM\DISTRIB.EXE" -Subscriber %Subscriber%
-SubscriberDB %SubscriptionDB% -SubscriberSecurityMode 1 -Publication %Publication%
-Publisher %Publisher% -PublisherDB %PublicationDB% -Distributor %Publisher%
-DistributorSecurityMode 1 -Continuous -SubscriptionType 0 -SubscriptionStreams 4
从这里: http ://technet.microsoft.com/en-us/library/ms147377(v=sql.105).aspx