EnumMergeAgentSessions Method (SQL-DMO)

The EnumMergeAgentSessions method returns a QueryResults object enumerating execution status data for the merge replication agent specified.

Applies To

DistributionPublisher Object

Syntax

object.EnumMergeAgentSessions( AgentName,
SessionType, SessionDuration ) as QueryResults

Part Description
object Expression that evaluates to an object in the Applies To list.
AgentName String identifying a merge replication agent by name.
SessionType Long integer indicating session type as described in Settings.
SessionDuration Long integer specifying a number of hours. Restricts result set membership to those sessions launched within the number of hours specified. Use 0 to specify no restriction on agent session start time.

Settings

Set SessionType by using these values.

Constant Value Description
SQLDMOSession_All 1 Output contains log information for all sessions for agent
SQLDMOSession_Errors 2 Output contains log information only for those execution attempts ending in error

Returns

A QueryResults object containing one result set defined by these columns.

Column Data type Description
runstatus integer Executing state. Interpret by using SQLDMO_TASKSTATUS_TYPE.
start_time nvarchar(26) Date and time of last scheduled execution.
time nvarchar(26) Date and time of message logging.
comments nvarchar(256) Descriptive text.
duration integer Elapsed time of the session.
  integer Average number of rows per second.
publisher_insertcount integer Number of inserts at the Publisher.
publisher_updatecount integer Number of updates at the Publisher.
publisher_deletecount integer Number of deletes at the Publisher.
publisher_conflicts integer Number of conflicts at the Publisher.
subscriber_insertcount integer Number of inserts at the Subscriber.
subscriber_updatecount integer Number of updates at the Subscriber.
subscriber_deletecount integer Number of deletes at the Subscriber.
subscriber_conflicts integer Number of conflicts at the Subscriber.
action_count integer Number of session history records.
error_id integer When nonzero, Microsoft® SQL Server™ error message number

Remarks

In the result set, date and time data returned in start_time and time is formatted as YYYYMMDD hh:mm:ss.fff where: YYYY represents the year in four digits; MM represents the month in two digits (zero padded); DD represents the day of the month in two digits; hh represents the hour using two digits, a twenty-four hour clock and zero padding; mm represents the minute in two digits (zero padded); ss represents the second in two digits (zero padded); and fff represents the fractional part of the second in three digits.

Prototype (C/C++)

HRESULT EnumMergeAgentSessions(
SQLDMO_LPCSTR AgentName,
SQLDMO_SESSION_TYPE SessionType,
long SessionDuration,
LPSQLDMOQUERYRESULTS* ppResults);

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.