I want to be able to check the status of a publication and subscription in SQL Server 2008 T-SQL. I want to be able to determine if its okay, when was the last successful, sync
Old post but adding for others - The following stored procedure will give you what you need:
It allows you to view the status plus other information for all replication publications for a distributor (run it on the distribution database)