Reputation: 915
I have setup SQL Server 2008 Transactional Replication between 2 databases. Once the replication session is complete, I want to execute a T-SQL script. Is there a configuration to setup Post Replication script or a mechanism to identify replication is complete and I can hook any script after replication is complete? In case we don't have this configuartion, can we use triggers to identify whether a table has been updated completely during replication and hence use trigger to invoke Post Replication script?
Upvotes: 1
Views: 994
Reputation: 2821
Yes, I would suggest to look at data from system tables to verify details of published tables
Which objects in the database are published?
Publish DB
Distribution DB
SubscriberDB
Hope it Helps.
Upvotes: 0
Reputation: 4014
Yes, check the @post_snapshot_script parameter of sp_addpublication, or the Properties page of the publication, under Snapshot, you'll find a section for "Run Additional Scripts" with an option for pre- and post scripts.
Upvotes: 1