EnumTaskLogRecords Method

DTS Programming

DTS Programming

EnumTaskLogRecords Method

The EnumTaskLogRecords method returns a TaskLogRecords collection containing data from the task log records in the database that satisfy the criteria of the input parameters.

Applies To
PackageSQLServer Object
Syntax

Set collection = object.EnumTaskLogRecords(
    StepExecutionID,
    SequenceID
)

Part Description
collection Expression that evaluates to a TaskLogRecords collection
object Expression that evaluates to a PackageSQLServer object
StepExecutionID A variant specifying the step execution ID to which the collection is to be limited
SequenceID A long specifying the sequence number of the desired task log record

Remarks

Task log records are not automatically written by the task classes supplied with Microsoft® SQL Server™ 2000, but the PackageLog interface is available so that a custom task or the script of an ActiveScriptTask object can write them. They are written to the msdb database in the instance of SQL Server specified by the package LogServerName property each time a task in a Data Transformation Services (DTS) package that has been implemented to write them is executed, if the package LogToSQLServer property has been set. SequenceID is a unique sequence number for each task log record.

Both parameters are required. To prevent a parameter from participating in the filter process, code NULL for StepExecutionID and 0 for SequenceID. Coding all parameters this way will cause all task log records in the database to be returned, which could result in an unmanageably large collection.

Prototype (C/C++)

HRESULT EnumTaskLogRecords(
    VARIANT StepExecutionID,
    long SequenceID,
    IDTSTaskLogRecords **pRetVal );

See Also

ActiveScriptTask Object

LogServerName Property

LogToSQLServer Property

PackageLog Object

RemoveTaskLogRecords Method

Retrieving DTS System, Package, and Log Data

SequenceID Property

StepExecutionID Property

TaskLogRecords Collection