Last active
June 30, 2016 05:15
-
-
Save mlongoria/be6a48fabcc32ea9a8a202f6d7abfde9 to your computer and use it in GitHub Desktop.
Demonstration of using text nuggets in Biml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<#* The variables below are control nuggets. | |
They will be discussed later but are needed for ths example.*#> | |
<# | |
var PackageName = "Stage_AW_SalesReason"; | |
var SourceTable = "SalesReason"; | |
var SourceSchema = "Sales"; | |
var DestinationTable = "SalesReason"; | |
var DestinationSchema = "Staging"; | |
#> | |
<Biml xmlns="http://schemas.varigence.com/biml.xsd"> | |
<Connections> | |
<OleDbConnection Name="AW2014" | |
ConnectionString = "Data Source=.\SQL2014;Initial Catalog=AdventureWorks2014;Integrated Security=SSPI;Provider=SQLNCLI11.1;"/> | |
<OleDbConnection Name="MyDataMart" | |
ConnectionString = "Data Source=.\SQL2014;Initial Catalog=AWBIML;Integrated Security=SSPI;Provider=SQLNCLI11.1;"/> | |
</Connections> | |
<Packages> | |
<Package Name="<#=PackageName#>" ConstraintMode="Linear" ProtectionLevel="DontSaveSensitive"> | |
<Tasks> | |
<ExecuteSQL Name="SQL Truncate_<#=DestinationTable#>" ConnectionName="AW2014"> | |
<DirectInput>Truncate Table [<#=DestinationSchema.ToUpper()#>].[<#=DestinationTable.ToUpper()#>];</DirectInput> | |
</ExecuteSQL> | |
<Dataflow Name="DFT Stage_<#=DestinationTable#>"> | |
<Transformations> | |
<OleDbSource Name="OLE_SRC <#=SourceTable#>" ConnectionName="AW2014" > | |
<DirectInput>SELECT * FROM [<#=SourceSchema.ToUpper()#>].[<#=SourceTable.ToUpper()#>]; | |
</DirectInput> | |
</OleDbSource> | |
<OleDbDestination Name="OLE_SRC <#=DestinationSchema#><#=DestinationTable#>" ConnectionName="MyDataMart"> | |
<ExternalTableOutput Table="<#=DestinationSchema#>.<#=DestinationTable#>"></ExternalTableOutput> | |
</OleDbDestination> | |
</Transformations> | |
</Dataflow> | |
</Tasks> | |
</Package> | |
</Packages> | |
</Biml> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment