title: SQL Server replication testing
body: <p>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.</p>
  
  <p>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:</p>
  
  <ol>
  <li><code>INSERT</code> a row into a replicated table in the publisher db</li>
  <li>Wait for replication job to run? </li>
  <li>Check the row exists in the table in the subscriber db</li>
  </ol>
  
  <p>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 <code>msdb..sysjob*</code> tables, but I'm not sure this is the best way to solve the problem.</p>