Monday, February 20, 2012

Missing fields in MSmerge_history table under SQL Server 2005

Hi,

I have a query that uses the following fields from MSmerge_history:

MSmerge_history.start_time, MSmerge_history.runstatus and MSmerge_history.duration

Below is the query that I am using:

SELECT

MSmerge_agents.subscriber_name AS SubscriberName,

MSmerge_history.start_time AS SyncTime,

MSmerge_history.runstatus AS SyncStatusID,

MSmerge_history.comments AS Comments,

MSmerge_history.duration AS Duration

FROM distribution.dbo.MSmerge_agents MSmerge_agents INNER JOIN distribution.dbo.MSmerge_history MSmerge_history

ON MSmerge_agents.id = MSmerge_history.agent_id

WHERE MSmerge_history.runstatus IN (2, 6) AND publisher_db = DB_NAME()

AND MSmerge_agents.subscriber_name + CONVERT(nvarchar, MSmerge_history.start_time) NOT IN

(SELECT SubscriberName + CONVERT(nvarchar, SyncTime) FROM SyncActivities)

My query runs fine under SQL Server 2000 but when I run it in SQL Server 2005, it doesn't work any more. Looking at MSmerge_history table under SQL Server 2005, this fields have been removed. Does anyone know where I can access those fields? Is it in another table?

thanks

Romeo

You should start using table distribution.dbo.MSmerge_sessions, which has a much better summary of all sync sessions.

No comments:

Post a Comment