SHAPE (DMX)
SQL Server 2012
Combines queries from multiple data sources into a single hierarchical table (that is, a table with nested tables), which becomes the case table for the mining model.
The complete syntax of the SHAPE command is documented in the Microsoft Data Access Components (MDAC) Software Development Kit (SDK).
You can use the following example within an INSERT INTO (DMX) statement to train a model containing a nested table. The two tables within the SHAPE statement are related through the OrderNumber column.
SHAPE {
OPENQUERY([Adventure Works DW Multidimensional 2012],'SELECT OrderNumber
FROM vAssocSeqOrders ORDER BY OrderNumber')
} APPEND (
{OPENQUERY([Adventure Works DW Multidimensional 2012],'SELECT OrderNumber, model FROM
dbo.vAssocSeqLineItems ORDER BY OrderNumber, Model')}
RELATE OrderNumber to OrderNumber)
