Skip to content

Create SSIS Project Parameters from Biml

Biml (Business Intelligence Markup Language) - Project Parameters from Biml

If you are using BIDS Helper or BimlExpress to generate SSIS packages in the Project Deployment model, you have probably noticed that it is not possible to create project parameters from Biml. You can write Biml for the project and project parameters, but BIDS Helper / BimlExpress will only generate the SSIS packages for you and not the SSIS project parameters. The recommended solution is that you create the project parameters manually before you generate your SSIS packages from Biml.

(Want to know why? Read Scott Currie’s explanation in my blog post Why can’t I create SSIS Project Parameters from Biml?)

However, if you are a lazy developer like me, you probably don’t want to create and update project parameters manually. Perhaps you want to automatically create or update project parameters based on some metadata? You can do that!

Let’s take a look at a (semi-hardcoded, semi-hack) solution for creating SSIS project parameters from Biml in BIDS Helper / BimlExpress :)


Luckily for us, the project parameters are specified in a separate file called Project.params in your project folder:

Project.params File

This is a very simple XML file that is easy to read and write. All we have to do is define our project parameters in Biml, specify where our Project.params file is located, and finally overwrite the Project.params file based on our Biml.

The Biml solution

The Biml solution is split in two Biml files to make it easy to use and maintain.

Download [download-attachment attachment_id=”3429″] (Last updated on December 10th 2015)

In the first Biml file (01-CreateProjectParameters.biml), we specify the Parameters and the Annotation Tag ProjectParametersPath with the full path to our Project.params file:

<Biml xmlns="">
    <PackageProject Name="ProjectParameters">
        <Annotation Tag="ProjectParametersPath">C:\SSIS\TestProject\Project.params</Annotation>
        <Parameter Name="ParameterBoolean" DataType="Boolean" IsRequired="false" IsSensitive="false">0</Parameter>
        <Parameter Name="ParameterDateTime" DataType="DateTime" IsRequired="false" IsSensitive="false">2015-11-04</Parameter>
        <Parameter Name="ParameterDecimal" DataType="Decimal" IsRequired="false" IsSensitive="false">3.14</Parameter>
        <Parameter Name="ParameterInt32" DataType="Int32" IsRequired="true" IsSensitive="false">1337</Parameter>
        <Parameter Name="ParameterString" DataType="String" IsRequired="false" IsSensitive="true">password</Parameter>

In the second Biml file (02-AddProjectParameters.biml), we overwrite the Project.params file based on our Biml. This is intended to be a utility file that you won’t need to change:

<#@ template tier="1000" #>
<#@ import namespace="System.IO" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="Varigence.Flow.FlowFramework.Validation" #>

  var project = RootNode.PackageProjects.FirstOrDefault();
  if (project == null) {
    ValidationReporter.Report(Severity.Error, "<PackageProject> does not exist");
  } else {
    var projectPath = project.GetTag("ProjectParametersPath");
    if (projectPath == "") {
      ValidationReporter.Report(project, Severity.Error, "Annotation ProjectParametersPath does not exist", @"Add <Annotation Tag=""ProjectParametersPath"">C:\SSIS\TestProject\Project.params</Annotation> to <PackageProject>");
    } else {

      try {

      var fileAttributes = File.GetAttributes(projectPath);
      if ((fileAttributes & FileAttributes.ReadOnly) == FileAttributes.ReadOnly) {
        File.SetAttributes(projectPath, (fileAttributes & ~FileAttributes.ReadOnly));

      StringBuilder parameters = new StringBuilder();
      parameters.AppendLine("<?xml version=\"1.0\"?>");
      parameters.AppendLine("<SSIS:Parameters xmlns:SSIS=\"\">");
      foreach (var parameter in project.Parameters) {
        parameters.AppendFormat("<SSIS:Parameter SSIS:Name=\"{0}\">", parameter.Name).AppendLine();
        parameters.AppendFormat("<SSIS:Property SSIS:Name=\"ID\">{{{0}}}</SSIS:Property>", (parameter.Id == Guid.Empty ?  Guid.NewGuid() : parameter.Id)).AppendLine();
        parameters.AppendFormat("<SSIS:Property SSIS:Name=\"DataType\">{0}</SSIS:Property>", Convert.ToByte(parameter.DataType)).AppendLine();
        parameters.AppendFormat("<SSIS:Property SSIS:Name=\"Value\">{0}</SSIS:Property>", parameter.Value).AppendLine();
        parameters.AppendFormat("<SSIS:Property SSIS:Name=\"Sensitive\">{0}</SSIS:Property>", Convert.ToByte(parameter.IsSensitive)).AppendLine();
        parameters.AppendFormat("<SSIS:Property SSIS:Name=\"Required\">{0}</SSIS:Property>", Convert.ToByte(parameter.IsRequired)).AppendLine();
        parameters.AppendFormat("<SSIS:Property SSIS:Name=\"IncludeInDebugDump\">{0}</SSIS:Property>", Convert.ToByte(parameter.IncludeInDebugDump)).AppendLine();
        parameters.AppendFormat("<SSIS:Property SSIS:Name=\"Description\">{0}</SSIS:Property>", parameter.GetTag("Description")).AppendLine();
        parameters.AppendFormat("<SSIS:Property SSIS:Name=\"CreationName\">{0}</SSIS:Property>", parameter.GetTag("CreationName")).AppendLine();

      File.WriteAllText(projectPath, parameters.ToString());

      } catch (Exception e) {
        ValidationReporter.Report(project, Severity.Error, "Error writing Project Parameters to Project.params", String.Format("Make sure the path \"{0}\" is correct and that this project uses the Project Deployment Model", projectPath));


The result

Add both Biml files to your SSIS project. Select both files, right-click and click Generate SSIS Packages. You will be prompted to reload the Project.params file that has been modified outside of the source editor. Click Yes / Yes to All, and you will see the new project parameters in your solution :)


This is a semi-hardcoded, semi-hack solution for creating SSIS project parameters from Biml in BIDS Helper / BimlExpress. I’m sure it can be improved and I would love to hear your suggestions! Right now it gets the job done for me, and I hope you will also find it useful :)

Download [download-attachment attachment_id=”3429″] (Last updated on December 10th 2015)

Published: Last Updated: Categories: BimlTags: ,

About the Author

Cathrine Wilhelmsen is a Microsoft Data Platform MVP, BimlHero Certified Expert, international speaker, author, blogger, and chronic volunteer. She loves data and coding, as well as teaching and sharing knowledge - oh, and sci-fi, chocolate, coffee, and cats :)


Hi! This is Cathrine. Thank you so much for visiting my blog. I'd love to hear your thoughts, but please keep in mind that I'm not technical support for any products mentioned in this post :) Off-topic questions, comments and discussions may be moderated. Be kind to each other. Thanks!

Works like a charm, Cathrine, thanks a lot for this workaround!
Keep up the good work :-)

Thank you, very happy to hear that! :)

Your solution works very well, thank you for making it public!

I’m just starting with BIML and project-level parameters were the first obstacle. Surprised to see that BIDS Helper doesn’t support them out of box when they are such fundamental parts of functionality from 2012.

Hi Istvan, you can read Scott Currie’s explanation over here :)

Cathrine – Very nice article. I have used your solution. Can we restricted the length of parameters? I just want to use a project parameter with length 8. Will it be possible? I have a very tricky problem.

Hi Manish, you can’t restrict the length of parameters in SSIS, so you can’t do that with Biml either.

Is this issue solved with using bimlexpress?

No, and it will not be solved in either BIDS Helper or BimlExpress unless Microsoft changes the way parameters are stored. Long story short (and I am currently writing a new blog post about this): it’s not possible to separate parameters that have been added manually and parameters that have been added via Biml. The only option is to overwrite the entire .params file and all the parameters. This could be an option for those who are using Biml only, but it is too risky to enable by default in add-ins like BIDS Helper and BimlExpress.

So in short, if you want to restrict the length of parameters than better to create parameters manually in SSIS and not use BIML :-) Thanks Cathrine and will wait for your post to hear the long story on your blog :-)

Very well explained and detailed explanation. Just love that :-) The only one question about workaround solution mentioned above. Can we allowed to define the length of string project params? You define string parameter like below in your example. In this case length of string parameter will be default as per SSIS. Can we do something like that so that we should have a choice to define the length of project parameters? Will eagerly wait to hear back from you?

Hi Manish, you can’t restrict the length of parameters in SSIS, so you can’t do that with Biml either.

This is awesome! Thank you for providing this. It has helped me quite a bit.

Just what is was looking for! Great Work Cathrine.

Nice solutions. Is it possible to have a relative path to the params file?

Is there a way to use a relative path to the Project.params file in the Annotation?

Can you please how would I reference these project parameters in my BIML?

Hey Cathrine! Great write-up and thanks for sharing. I’m assuming this is only an issue for BimlExpress and BI Dev Extenstions users who are executing their Biml scripts from within Visual Studio, correct?

Hi! This is Cathrine (again). Just a reminder. I'd love to hear your thoughts, but please keep in mind that I'm not technical support for any products mentioned in this post :) Off-topic questions, comments and discussions may be moderated. Be kind to each other. Thanks!

Share Your Thoughts?