Skip to content

Instantly share code, notes, and snippets.

@dgosbell
Last active December 7, 2016 00:50
Show Gist options
  • Save dgosbell/a7bc9fe9ff5a99fdb4df5819b8760217 to your computer and use it in GitHub Desktop.
Save dgosbell/a7bc9fe9ff5a99fdb4df5819b8760217 to your computer and use it in GitHub Desktop.
Working TMSL Examples
// working examples to replace ones from https://msdn.microsoft.com/en-us/library/mt697588.aspx?f=255&MSPPError=-2147217396
{
"refresh" : {
"type" : "dataOnly",
"objects" : [{
"database" : "AdventureWorks2016",
"table" : "Customer"
}
],
"overrides" : [{
"dataSources" : [// Bindings for DataSources
{
originalObject : {
"database" : "AdventureWorks2016",
"dataSource" : "SqlServer localhost"
},
"connectionString" : "Provider=SQLNCLI11;Data Source=localhost\\sql12;Integrated Security=SSPI;Persist Security Info=false;Initial Catalog=AdventureWorksDW2012"
}
],
"partitions" : [// Bindings for Partitions
{
"originalObject" : {
"database" : "AdventureWorks2016",
"table" : "Customer",
"partition" : "Customer"
},
"source" : {
"query" :
"SELECT * FROM [dbo].[DimCustomer]"
}
}
]
}
]
}
}
// working examples to replace ones from https://msdn.microsoft.com/en-us/library/mt697587.aspx?f=255&MSPPError=-2147217396
// creates 2 partitions in the one sequence operation
{
"sequence" : {
"maxParallelism" : 3,
"operations" :
[{
"createOrReplace" : {
"object" : {
"database" : "AdventureWorks2016",
"table" : "Reseller Sales",
"partition" : "Reseller Sales 2005"
},
"partition" : {
"name" : "Reseller Sales 2005",
"dataView" : "full",
"source" : {
"query" : "SELECT [dbo].[FactResellerSales].* \t\tFROM [dbo].[FactResellerSales] WHERE (([OrderDateKey] >= 20050101) AND ([OrderDateKey] <= 20051231))",
"dataSource" : "SqlServer localhost"
}
}
}
}, {
"createOrReplace" : {
"object" : {
"database" : "AdventureWorks2016",
"table" : "Reseller Sales",
"partition" : "Reseller Sales 2006"
},
"partition" : {
"name" : "Reseller Sales 2006",
"mode" : "import",
"dataView" : "full",
"source" : {
"query" : "SELECT [dbo].[FactResellerSales].* \t\tFROM [dbo].[FactResellerSales] WHERE (([OrderDateKey] >= 20060101) AND ([OrderDateKey] <= 20061231))",
"dataSource" : "SqlServer localhost"
}
}
}
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment