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

Find ramblings

Thursday, February 20, 2014

Biml - Execute T-SQL Statement Task

Execute T-SQL Statement Task

The Execute T-SQL Statement Task is another of the Maintenance Tasks. As such, you'll need an ADO.NET connection to make this work.

<Biml xmlns="http://schemas.varigence.com/biml.xsd">
    <Connections>
        <AdoNetConnection Name="CM_ADO_DB" ConnectionString="Data Source=localhost\dev2012;Integrated Security=SSPI;Connect Timeout=30;Database=msdb;" Provider="SQL"  />
    </Connections>

    <Packages>
        <Package ConstraintMode="Linear" Name="ExecuteTSQLStatement">
            <Tasks>
                <ExecuteTSqlStatement 
                    ConnectionName="CM_ADO_DB" 
                    Name="ETS POC">
                    <SqlStatementSource>SELECT 100 As Foo;</SqlStatementSource>
                </ExecuteTSqlStatement>
            </Tasks>
        </Package>
    </Packages>
</Biml>

Result

A package is built out with an ADO.NET Connection Manager and the Execute T-SQL Statement Task.

Execute T-SQL Statement Task

No comments: