Database Reference
In-Depth Information
Generating the SSIS Command-Line
We can do even more using BimlScript, though. We can generate the command-line to
execute the SSIS Application using the Framework's Parent.dtsx package.
Open the i-FrameworkSQLGen.biml file and add a couple more variables, as
shown in Listing 20-10 :
Listing 20-10 . Adding Variables to the i-FrameworkSQLGen.biml File
string FrameworkParentPkgPath
= @"E:\Projects\SSISConfig2014\SSISConfig2014\Parent.dtsx";
string CmdFilename = @"G:\out\MyCmd.cmd";
Your file locations will be different from those shown in Listing 20-10 .
Add a new Biml file to your solution and rename it “GenerateExecCmd.biml.” Add
the following statements to GenerateExecCmd.biml, shown in Listing 20-11 :
Listing 20-11 . Building the GenerateExecCmd.biml File
<#@ template language="C#" tier="2" #>
<#@ include file="i-FrameworkSQLGen.biml" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="System.IO" #>
<# StringBuilder sb = new StringBuilder();
sb.AppendLine("dtexec /FILE "
+ FrameworkParentPkgPath + " /SET
\\Package.Variables[ApplicationName].Properties[Value];"
+ applicationName);
using (StreamWriter outfile = new
StreamWriter(CmdFilename))
{
outfile.Write(sb.ToString());
}
#>
Right-click the GenerateExecCmd.biml file in Solution Explorer and click “Gener-
ate SSIS Packages.” Open Windows Explorer and browse to the folder you supplied for
 
 
 
 
Search WWH ::




Custom Search