Win32::SqlServer::DTS::Package::Step - a Perl class to access Microsoft SQL Server 2000 DTS Package's steps


    use Win32::SqlServer::DTS::Package::Step;

        # previously Win32::SqlServer::DTS::Package recovered
    my $steps   = $package->get_sibling()->Steps;

        foreach my $step ( in( $steps ) ) {

                my $new_step = Win32::SqlServer::DTS::Package::Step->new($step);
                print $new_step->get_exec_status(), "\n";



Win32::SqlServer::DTS::Package::Step implements the DTS Package Step class in Perl. It implements all features of the original class, offering pure Perl interface with some additional methods to easy of use.

You probably will want to deal with this class internals only if you need to extended it or fix a bug. Otherwise, keep to fetching Win32::SqlServer::DTS::Package::Step objects directly from a Win32::SqlServer::DTS::Package object.





Instantiates a new Win32::SqlServer::DTS::Package::Step object. Expects as a parameter the original DTS Package Step.

Almost all attributes from the original objects (Step and Step2) were implement, except the Parent attribute. This class has a hash that defines the convertion from the original attributes names to those implements in Win32::SqlServer::DTS::Package::Step. It's possible to check them out by looking at the %attrib_convertion hash.

Win32::SqlServer::DTS::Package::Step inherits all methods defined in the DTS class.

read and write attributes

The following attributes have their get_/set_ methods available (for example, name attribute will have a get_name and set_name methods):

  • name

  • task_name

  • script_lang

  • activex

  • description

  • func_name

read only attributes

The following attributes are read only, so they will have only get_ attributes:

  • exec_status_code

  • start_time

  • exec_time

  • finish_time

  • exec_result


Returns true if the step is disabled or false otherwise.


Disables the step.

Abort program execution if the _sibling attribute is not defined.


Enables the step. This changes the Win32::SqlServer::DTS::Package object, that must have it's appropriate methods to save it's state back to the server (or file).

Abort program execution if the _sibling attribute is not defined.


"Private" method. It expects a attribute name as a parameter (string) and returns a default error message when trying to update the original Step object when the _sibling attribute is not defined.


Overriding Class::Accessor method to check for _sibling attribute. This is used internally by the module and should not be used unless the behaviour of the class must be changed.


Same as GetExecutionErrorInfo method from the original DTS Step object.

Returns a Win32::SqlServer::DTS::Package::Step::Result object. It will fail if the sibling object is not available.


Returns a string telling the execution status instead of a numeric code as get_exec_status_code does.

Convertion table was fetched from MSDN documentation and reproduced in the package @exec_status array.


Returns true if the property AddGlobalVariables is enabled, false otherwise.


Enable the property AddGlobalVariables.


Disable the property AddGlobalVariables.


Returns true if the CloseConnection attribute is active, false otherwise.


Enables the CloseConnection attribute.


Disables the CloseConnection attribute.


Returns true if the FailPackageOnError attribute is active, false otherwise.


Enables the FailPackageOnError attribute.


Enables the FailPackageOnError attribute.


Any change to Win32::SqlServer::DTS::Package::Step must be saved by using the proper methods in the Win32::SqlServer::DTS::Package object or they will be lost as soons as the Step object is eliminated by the garbage collector.

All methods that changes object state and needs to sincronize with the original DTS Package Step object will abort program execution if the _sibling attribute does not exists or does not have a valid value.


  • Win32::OLE at perldoc.

  • Win32::SqlServer::DTS::Package at perldoc to see how to fetch Win32::SqlServer::DTS::Package::Step objects.

  • MSDN on Microsoft website and MS SQL Server 2000 Books Online are a reference about using DTS' object hierarchy, but one will need to convert examples written in VBScript to Perl code. Specially, there is all attributes description there.


Alceu Rodrigues de Freitas Junior, <>


Copyright (C) 2008 by Alceu Rodrigues de Freitas Junior

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.