Wednesday, September 12, 2012

BIML Reorganize Index

Example file for creating a Reorganize Index SSIS Package
<Biml xmlns="http://schemas.varigence.com/biml.xsd">
    <Connections>
        <AdoNetConnection
            Name ="CnAdoAdventureWorks2012"
            Provider="System.Data.SqlClient.SqlConnection, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
            ConnectionString ="Data Source=.\MSSQL2012;Integrated Security=SSPI;Connect Timeout=30;"
            RetainSameConnection="true">
        </AdoNetConnection>
    </Connections>
    <Packages>
        <Package Name ="Maintenance.ReorganizeIndex" ConstraintMode="Linear">
            <Annotations>
                <Annotation>
                    File: Maintenance.ReorganizeIndex.biml
                    Demo biml for setting up a Reorganize Index package
                    Enviroment:
                    DB: MS-SQL2012
                    BIML: 1.6 VS2010 BIDS Helper
                    (c) John Minkjan biml101.blogspot.com
                </Annotation>
            </Annotations>
            <Tasks>
                <ReorganizeIndex
                    Name="ROI AdventureWorks2012"
                    ConnectionName="CnAdoAdventureWorks2012" 
                    ObjectSelectionMode="Tables"
                    AllTablesAndViews="true"            
                    DatabaseSelectionMode="Specific"
                    CompactLargeObjects="true"
                >
                    <Databases>
                        <Database>AdventureWorks2012</Database>
                    </Databases>
                </ReorganizeIndex>
            </Tasks>
        </Package>
    </Packages>
</Biml>
Till Next Time

No comments:

Post a Comment