GetAgentsStatus Method (Distributor)
Microsoft SQL Server의 이후 버전에서는 이 기능이 제거됩니다. 새 개발 작업에서는 이 기능을 사용하지 않도록 하고, 현재 이 기능을 사용하는 응용 프로그램은 수정하십시오.
The GetAgentsStatus2 method returns a high level report of execution state for replication agents implementing a Distributor.
구문
object
.GetAgentsStatus(
AgentType
,
ReturnedStatus
,
TimeStamp
)
Parts
object
Expression that evaluates to an object in the Applies To list.AgentType
Long integer that specifies a type of replication agent as described in Settings.ReturnedStatus
Enumerated long value returned.TimeStamp
String value returned.
Prototype (C/C++)
HRESULT GetAgentsStatus(
SQLDMO_REPLAGENT_TYPE AgentType,
SQLDMO_TASKSTATUS_TYPE* pRetValStatus,
SQLDMO_LPBSTR pRetValTimeStamp = NULL);
[!참고]
SQL Distributed Management Objects (SQL-DMO) strings are always returned as OLE BSTR objects. A C/C++ application obtains a reference to the string. The application must release the reference using SysFreeString.
Settings
Set the AgentType argument using these SQLDMO_REPLAGENT_TYPE values.
Constant |
Value |
Description |
---|---|---|
SQLDMOReplAgent_All |
0 |
All replication agent types. |
SQLDMOReplAgent_/Distribution |
3 |
Distribution Agent. |
SQLDMOReplAgent_/LogReader |
2 |
Replication transaction log monitoring agent. |
SQLDMOReplAgent_Merge |
4 |
Merge Agent. |
SQLDMOReplAgent_/Miscellaneous |
5 |
Agents not otherwise classified. |
SQLDMOReplAgent_/Publishers |
-1 |
Agents supporting publishers. |
SQLDMOReplAgent_/QueueReader |
9 |
Replication Queue Reader Agent. |
SQLDMOReplAgent_/Snapshot |
1 |
Snapshot Agent. |
Returns
Interpret the value returned in the ReturnedStatus argument using these SQLDMO_TASKSTATUS_TYPE values.
Constant |
Value |
Description |
---|---|---|
SQLDMOTask_Failed |
6 |
At least one agent-implementing job has failed to execute successfully. |
SQLDMOTask_Idle |
4 |
All agent-implementing jobs are scheduled and idle. |
SQLDMOTask_Pending |
0 |
All agent-implementing jobs are waiting to start. |
SQLDMOTask_Retry |
5 |
At least one agent-implementing job is attempting to execute after a previous failure. |
SQLDMOTask_Running |
3 |
At least one agent-implementing job is executing. |
SQLDMOTask_Starting |
1 |
One or more agent-implementing jobs are starting. |
SQLDMOTask_Succeeded |
2 |
All agent-implementing jobs have executed successfully. |
The TimeStamp argument returns a timestamp(binary) value as a hexadecimal character string.
주의
When using Microsoft Visual Basic as a SQL-DMO application development environment, use the subroutine call statement syntax to execute the GetAgentsStatus method successfully.
The GetAgentsStatus2 method extends the functionality of the GetAgentsStatus method.