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?
Asked
Active
Viewed 948 times
2 Answers
1
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.

SqlACID
- 4,024
- 20
- 28
0
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
- SELECT * FROM sysarticles
- SELECT * FROM syspublications
Distribution DB
- Use Distribution
- GO
- SELECT * FROM distribution..mspublications
SubscriberDB
- USE SubscriptionDB
- SELECT * FROM MSsubscriptions
- SELECT * FROM MSsubscriber_info
Hope it Helps.

Siva
- 2,791
- 5
- 29
- 33