How to get Transactional Replication Status and Last Run Time Using T-Sql

  • Hi All,

    I have transactional replication between two databases. now i want to know the repication status and when job run and error detail if any error in replication, by using tsql. Like in a replicaton monitor.

    Please guide what to do.

    Thanks,

    Noman

  • HI Noman,

    In distribution database you can run sp_browsereplcmnds with different parameters:

    this sp takes data from MSrepl_commands table which is present in distribution DB for transactional replication.

    MSDN link is

    http://msdn.microsoft.com/en-us/library/aa239422(SQL.80).aspx

    and for error read in DIST. Db

    see

    MSrepl_errors,MSdistribution_history,MSdistribution_history

    Regards

    Mayank Tyagi

  • Thankyou, but help me to find out the summary line for each publication. like this:

    publication1 Running 2010-08-19 00:00:000

    Publication2 Failed 2010-08-19 Error message

    Thanks again.

    Noman

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply