Using Execute SQL Parameters

gravatar

cell

This snippet demonstrates the ExecuteSQL task, specifically using its parameters collection with its SQL query.

published 09.07.12

last updated 09.09.12


Share

                            


<Biml xmlns="http://schemas.varigence.com/biml.xsd">
    <Packages>
        <Package Name="Package1" ConstraintMode="Parallel">
            <Variables>
                <Variable Name="etlp_BatchId" DataType="Int32" EvaluateAsExpression="false" InheritFromPackageParentConfigurationString="User::etlp_BatchId">0</Variable>
                <Variable Name="etlp_PackageLogId" DataType="Int32">0</Variable>
                <Variable Name="etlp_BatchName" DataType="String">Test Batch</Variable>
            </Variables>
            <Tasks>
                <ExecuteSQL Name="SQL LogPackageEnd">
                    <DirectInput>EXEC etlp.LogPackageEnd ?,?,?</DirectInput>
                    <Parameters>
                        <Parameter Name="0" VariableName="User.etlp_PackageLogId" />
                        <Parameter Name="1" VariableName="User.etlp_BatchId" />
                        <Parameter Name="2" VariableName="User.etlp_EndBatchAudit" />
                    </Parameters>
                </ExecuteSQL>
            </Tasks>
        </Package>
    </Packages>
</Biml>
                        

In an Execute SQL task, the DirectInput SQL query uses the ? character to specify parameters. The query's parameters are then added in the task's Parameters collection.

You are not authorized to comment. A verification email has been sent to your email address. Please verify your account.

Comments

There are no comments yet.