如何以编程方式启动 SQL Server 2005 合并复制
我们目前设置了合并复制来合并两个数据库之间的某些表。我需要以编程方式启动其中一个出版物,以确保在开始某项作业之前数据已同步。 SQL Server 联机丛书并没有太大帮助。
到目前为止,我唯一想到的是使用 sp_start_job 来启动合并复制 sql 作业。这样做可以吗?
是否有其他方法可以以编程方式开始同步出版物?
We currently have merge replication set up to merge certain tables between two databases. I need to programmatically start one of the publications to make sure data has been synchronized prior to starting a certain job. SQL Server Books Online has not been too helpful.
So far, the only thing I have come up with is to use sp_start_job to start the merge replication sql job. Is it ok to do this?
Are there any other ways to programmatically start synchronizing a publication?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我们最终使用 sp_start_job 和合并复制发布的名称。我们发现的唯一缺点是,sql 作业的名称是在创建发布时动态生成的,因此如果删除并重新创建发布,则名称将会更改。除此之外,使用 sp_start_job 效果很好。
还有其他一些事情:
We ended up using the sp_start_job with the name of the merge replication publication. The only downside that we found was that the name of the sql job is dynamically generated when the publication is created so if the publication is drop and recreated, then the name will change. Other than that using sp_start_job has worked beautifully.
Couple other things: