I'd like to write a sql script to do a basic smoke test to check that the replication setup on my server is correct.
I think a simple set of CRUD operations against the tables that are supposed to be replicated will achieve what I'm after and I imagine the workflow will look something like this:
INSERT
a row into a replicated table in the publisher db- Wait for replication job to run?
- Check the row exists in the table in the subscriber db
My question is, how do I do step 2? I think I can check when the relevant job was last executed by looking in the msdb..sysjob*
tables, but I'm not sure this is the best way to solve the problem.