Database Reference
In-Depth Information
namespace="Varigence.Hadron.CoreLowerer.SchemaManagement"
#>
<# var connection
= SchemaManager.CreateConnectionNode("SchemaProvider",
connectionString); #>
<# var tables = connection.GenerateTableNodes();
int e = 10;
StringBuilder sb = new StringBuilder();
The template directive on line 1 idenitifies the .Net language I will use in this file
(C#) and the “tier” of this file.
Note Learn more about Biml tiers and the language constructs in Reeves Smith's ex-
cellent article “Stairway to Biml Level 5 - Biml Language Elements” at SQLServerCen-
tral.com ( http://www.sqlservercentral.com/articles/BIML/
111305/ ) .
The “include file” directive is next and points to the i-FrameworkSQLGen.biml I
built first. Including this file means the variables defined in i-FrameworkSQLGen.biml
are available in the FrameworkSQLGen.biml file. I next include four namespaces: Sys-
tem.Data, System.IO, System.Text, and Vari-
gence.Hadron.CoreLowerer.SchemaManagement. The first three refer to .Net libraries;
the fourth supplies a reference to a Biml assembly.
The C# application logic begins in earnest starting with Line 7 with the declaration
and initialization of the variable named “connection.” Connection is set to the Schem-
aManager object's ConnectionNode object via the CreateConnectionNode method. The
ConnectionNode is aimed at the ConnectionString supplied from the variable “conec-
tionString” contained in the i-FrameworkSQLGen.biml include file.
Another C# variable named “tables” is declared and initialized using the connection
variable's GenerateTableNodes method. The GenerateTableNodes method creates a
collection of table objects ready for consumption by BimlScript.
Two additional variables are declared and initialized: an int variable named “e”
which will be used to enumerate the execution order of packages in the Framework,
and a StringBuilder variable named “sb” which will be used to build the Transact-SQL
command to load the Framework metadata for the SSIS Application.
The Transact-SQL script for adding an SSIS Application to the Framework is listed
in Figure A-7 in Appendix A and is shown in Listing 20-3 .
 
Search WWH ::




Custom Search