后续版本的 Microsoft SQL Server 将删除该功能。请避免在新的开发工作中使用该功能,并着手修改当前还在使用该功能的应用程序。
The EnumSnapshotAgentViews method returns a QueryResults object that enumerates historical data for all Snapshot Agents.
语法
object
.EnumSnapshotAgentViews( )
as 
QueryResults
Parts
- object
 Expression that evaluates to an object in the Applies To list.
Prototype (C/C++)
HRESULT EnumSnapshotAgentViews(
LPSQLDMOQUERYRESULTS* ppResults);
Returns
A QueryResults object that contains one result set defined by these columns.
| Column | Data type | Description | 
|---|---|---|
| agent_id | integer | Agent identifier. | 
| comments | nvarchar(256) | Descriptive text. | 
| dbname | nvarchar(129) | Name of the database used for distribution. | 
| delivered_/commands | integer | Cumulative number of commands. | 
| delivered_/transactions | integer | Cumulative number of transactions. | 
| delivery_rate | float | Average number of commands delivered per second. | 
| duration | integer | Cumulative run time in seconds. | 
| error_id | integer | When nonzero, the Microsoft SQL Server error message number of the most recent error. | 
| job_id | binary(22) | Identifier of the SQL Server Agent job starting the replication agent. | 
| local_job | bit | Reserved. | 
| local_timestamp | binary(14) | Timestamp. | 
| name | nvarchar(101) | Name of the Distribution Agent. | 
| profile_id | integer | Profile identifier. | 
| publication | nvarchar(129) | Publication name. | 
| publisher | nvarchar(129) | Publisher name. | 
| publisher_db | nvarchar(129) | Name of database published. | 
| start_time | nvarchar(25) | Date and time at which agent started. | 
| status | integer | Agent status. Interpret using SQLDMO_TASKSTATUS_TYPE. | 
| time | nvarchar(25) | Date and time message logged. | 
备注
In the result set, date and time data returned in start_time and time is formatted as YYYYMMDD hh:mm:ss.fff.
| Date part | Description | 
|---|---|
| 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 (zero padded). | 
| hh | Represents the hour using two digits, a twenty-four hour clock (zero padded). | 
| mm | Represents the minute in two digits (zero padded). | 
| ss | Represents the second in two digits (zero padded). | 
| fff | Represents the fractional part of the second in three digits. | 
For example, the value 20040512 18:12:00.000 is interpreted as 6:12 P.M., May 12, 2004.