Supports drillthrough, returning the cases that were used to train the model. If drillthrough is not enabled on the model, the statement will fail. In Data Mining Extensions (DMX) you can only enable drillthrough when you create the model.

For more information about enabling drillthrough, see CREATE MINING MODEL (DMX), SELECT INTO (DMX), and ALTER MINING STRUCTURE (DMX).


SELECT [FLATTENED] [TOP <n>] <expression list> FROM <model>.CASES
[WHERE <condition expression>][ORDER BY <expression> [DESC|ASC]]


  • n
    Optional. An integer that specifies how many rows to return.
  • expression list
    A comma-separated list of related column identifiers.
  • model
    A model identifier.
  • condition expression
    A condition to restrict the values that are returned from the column list.
  • expression
    Optional. An expression that returns a scalar value.


The Lag function can be used with time series models to return or filter on the time lag between each case and the initial time.

Using the IsInNode function in the WHERE clause returns only cases that are associated with the node that is specified by the NODE_UNIQUE_NAME column of the schema rowset.

Drillthrough Example

The following example returns the columns for all the cases that were used to train the Target Mail model. You can use the expression list to return whatever columns you need.

Select * from [TM Decision Tree].Cases

Drillthrough Using IsInNode Example

The following example returns just those cases that were used to train the node whose value for the NODE_UNIQUE_NAME column is '0000000010403'.

Select * from [TM Decision Tree].Cases
WHERE IsInNode('0000000010403')

See Also


Data Mining Extensions (DMX) Data Definition Statements
Data Mining Extensions (DMX) Data Manipulation Statements
Data Mining Extensions (DMX) Statement Reference

Help and Information

Getting SQL Server 2005 Assistance