문제

I am using SQL Server 2008 and have transactional replication setup. I need to be able to execute a pre replication script on the publisher and then a post replication script on the subscriber. Is this possible with transactional replication?

I have found this other article on here, but the post script here only gets executed when the snapsnot is delivered to the subscriber.

도움이 되었습니까?

해결책

This will work if you are running the Distribution Agent on a schedule. Edit the Distribution Agent SQL Agent job. Add a step prior to the Run Agent job step to execute a SQL script on the Publisher. Then add a step after the Run Agent job step which executes sp_addscriptexec to post a SQL script to the Subscriber.

I have a post describing sp_addscriptexec in Executing scripts with sp_addscriptexec. I recommend trying this in your test environment prior to deploying to production.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top