A blog about SQL Server, SSIS, C# and whatever else I happen to be dealing with in my professional life.

Find ramblings

Monday, February 24, 2014

Biml - Execute Process Task

Biml - Execute Process Task

The Execute Process Task allows you to invoke any executable. While it should be obvious, don't run programs that have graphical user elements.

<Biml xmlns="http://schemas.varigence.com/biml.xsd">
    <Packages>
        <Package ConstraintMode="Linear" Name="Task_ExecuteProcess">
            <Variables>
                <Variable DataType="String" Name="StandardIn"></Variable>
                <Variable DataType="String" Name="StandardOut"></Variable>
                <Variable DataType="String" Name="StandardErr"></Variable>
                <Variable DataType="String" Name="Executable">J:\Windows\System32\ipconfig.exe</Variable>
            </Variables>
            <Tasks>
                <ExecuteProcess
                    Executable="J:\Windows\System32\ipconfig.exe"
                    Name="EP Ipconfig"
                    WorkingDirectory="J:\windows\System32"
                    StandardInputVariableName="User.StandardIn"
                    StandardErrorVariableName="User.StandardErr"
                    StandardOutputVariableName="User.StandardOut"
                    >
                    <Expressions>
                        <Expression PropertyName="Executable">@[User::Executable]</Expression>
                    </Expressions>

                </ExecuteProcess>
            </Tasks>
        </Package>
    </Packages>
</Biml>

Result

A package is generated that calls ipconfig and assigns the results to standard out and standard error SSIS Variables.

EP Ipconfig

Process

As usual, I have everything driven by SSIS Variables. The "Executable" appears to be hard coded but you'll see there's actually an expression on it.

Expressions

Execution Results

You can see the results of executing the generated package. The output of ipconfig is assigned to our Variable User::StandardOut

No comments: