Shaped Cursor Test (SQL 2000)

The SHAPE statement is able to produce three different types of hierarchical recordsets:

A relation hierarchy is a set of parent records and associated child records.

A parameterized hierarchy also contains parent records and associated child records, but fetches child records on demand.

A grouping hierarchy is a parent recordset composed of aggregate functions and the related detail records as the children.


A relation hierarchy (demonstrated here) represents a set of parent records and associated child records. This recordset is similar to the recordset you can create with a SQL JOIN statement, but it doesn’t have the redundancy of a recordset based on a JOIN.