后续版本的 Microsoft SQL Server 将删除该功能。请避免在新的开发工作中使用该功能,并着手修改当前还在使用该功能的应用程序。
The GetAgentsStatus method returns a high level report of execution state for replication agents implementing the publications of a Publisher.
语法
object
.GetAgentsStatus( 
ReturnedStatus
, 
TimeStamp
)
Parts
- object
 Expression that evaluates to an object in the Applies To list.
- ReturnedStatus
 Enumerated long value returned.
- TimeStamp
 String value returned.
Prototype (C/C++)
HRESULT GetAgentsStatus(
SQLDMO_TASKSTATUS_TYPE* pRetValStatus,
SQLDMO_LPBSTR pRetValTimeStamp = NULL);
| .gif) 注意: | 
|---|
| 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. | 
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 successfully executed. | 
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.
Applies To:
请参阅
参考
GetAgentsStatus2 Method (DistributionPublication2, DistributionPublisher2)