Project Parameters and BimlScript

While working on a Biml project the other day, I really wanted to embrace the project deployment model with Biml.

I have created a couple of integration services frameworks which have all used package configurations to enable dynamic configurations. The package configuration methodology that I used followed the Project REAL guidelines and other Integration Services best practices. Now it was time to use the project deployment model with Biml.
The following example is very contrived, and kept simple for this walk through. I want to show you the Biml concept and you must address how to apply it to your individual issues.

When building projects in Biml I really suggest that you start off with small steps. Let me say that again, small steps.
I always start off by creating the Biml file without BimlScript. Add the BimlScript after you get the Biml file to create a package without errors.

<Biml xmlns=”http://schemas.varigence.com/biml.xsd”&gt;

    <PackageProjects>
        <PackageProject Name=”ProjectConfigurations”>
            <Parameters>
                <Parameter Name=”Something” DataType=”String”>No Big Deal</Parameter>
            </Parameters>
            <Packages>
                <Package PackageName=”TestPackage”>
            </Packages>
        </PackageProject>
    </PackageProjects>

    <Packages>
        <Package Name=”TestPackage” ConstraintMode=”Linear” />
    </Packages>

</Biml>

Next I add the details needed to create two packages. In this example I am creating two packages named: test package 1 and 2.

<Biml xmlns=”http://schemas.varigence.com/biml.xsd”&gt;

    <PackageProjects>
        <PackageProject Name=”ProjectConfigurations”>
            <Parameters>
                <Parameter Name=”Something” DataType=”String”>No Big Deal</Parameter>
            </Parameters>
            <Packages>
                <Package PackageName=”TestPackage1″>
                <Package PackageName=”TestPackage2″>
            </Packages>
        </PackageProject>
    </PackageProjects>

    <Packages>
        <Package Name=”TestPackage1″ ConstraintMode=”Linear” />
        <Package Name=”TestPackage2″ ConstraintMode=”Linear” />
    </Packages>

</Biml>

Then I added a BimlScript to automate the creation of multiple packages.

Note: A complete list of all the packages must be added to the <Packagescollection within the <PackageProjectscollection as well as the <Packages> collection outside of the <PackageProjects> collection.

Note: The order of the items within the collections do not have to match, but they must contain the exact items.

<Biml xmlns=”http://schemas.varigence.com/biml.xsd”&gt;

    <PackageProjects>
        <PackageProject Name=”ProjectConfigurations”>
            <Parameters>
                <Parameter Name=”Something” DataType=”String”>No Big Deal</Parameter>
            </Parameters>
            <Packages>
                <# for (int i = 1; i <= 5; i++) { #>
                    <Package PackageName=”TestPackage<#= i #>“>
                <# } #>
            </Packages>
        </PackageProject>
    </PackageProjects>

    <Packages>
        <# for (int i = 1; i <= 5; i++) { #>
            <Package Name=”TestPackage<#= i #> ConstraintMode=”Linear” />
        <# } #>
    </Packages>

</Biml>

Hope this help you get started.

-Reeves

About Reeves Smith

Reeves Smith is a consultant and trainer. He holds a Bachelor’s Degree in Applied Mathematics from University of Colorado at Colorado Springs and a Microsoft Certified Master with over 17 years of experience working with SQL Server. Reeves is an independent BI consultant and teammate with Linchpin People. He is an active member of the Denver, CO, PASS chapter and delivers technical presentations at local and regional conferences and user groups. He has had the opportunity to work on various development and data warehouse projects within industries like banking, DoD, energy, entertainment, gaming, healthcare, manufacturing, oil and gas, travel, and telecommunication. You can follow him on Twitter at SQLReeves.
This entry was posted in Biml. Bookmark the permalink.

One Response to Project Parameters and BimlScript

  1. Drickus Annandale says:

    Hi

    I tried creating project paramaters in SSDT 2010 using BidsHelper but this did not work. I read the following post on the Codeplex website (https://bidshelper.codeplex.com/discussions/447353) that said this functionality is only available in Mist and not with BIML in Bidshelper.

    My question is did you use Bidshelper to generate the packages with it’s project parameter.?

    Regards, Drickus

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s