--- title: "Formal Shape Grammar | Microsoft Docs" ms.prod: sql ms.prod_service: connectivity ms.technology: connectivity ms.custom: "" ms.date: "01/19/2017" ms.reviewer: "" ms.topic: conceptual helpviewer_keywords: - "shape commands [ADO], shape grammar" - "data shaping [ADO], shape grammar" ms.assetid: ea691475-0f03-4abe-a785-b77e77712d1d author: MightyPen ms.author: genemi --- # Formal Shape Grammar This is the formal grammar for creating any shape command: - Required grammatical terms are text strings delimited by angle brackets ("<>"). - Optional terms are delimited by square brackets ("[ ]"). - Alternatives are indicated by a virgule ("|"). - Repeating alternatives are indicated by an ellipsis ("..."). - *Alpha* indicates a string of alphabetical letters. - *Digit* indicates a string of numbers. - *Unicode-digit* indicates a string of unicode digits. All other terms are literals. |Term|Definition| |----------|----------------| |\|SHAPE [\ [[AS] \]][\]| |\|{\} |

(\) |

TABLE \ |

\| |\|APPEND \ |

COMPUTE \ [BY \]| |\|\ [, \]| |\|\ [[AS] \]| |\|(\) |

\ |

\ |

\| ||\ [[AS] \]

RELATE \| |\|\ [, \...]| |\|\ TO \| |\|\ |

PARAMETER \| |\|\| |\|\ [, \]| |\|SUM(\) |

AVG(\) |

MIN(\) |

MAX(\) |

COUNT(\ | \) |

STDEV(\) |

ANY(\)| |\|CALC(\)| |\|\.[\...]\| |\|\| |\|\ [[AS] \]| |\|"\" |

'\' |

[\] |

\| |\|alias[.alias...]| |\|alpha [ alpha | digit | _ | # | : | ...]| |\|digit [digit...]| |\|NEW \ [(\ [, \])]| |\|An OLE DB or ADO data type.| |\|unicode-char [unicode-char...]| |\|A Visual Basic for Applications expression whose operands are other non-CALC columns in the same row.| ## See Also [Accessing Rows in a Hierarchical Recordset](../../../ado/guide/data/accessing-rows-in-a-hierarchical-recordset.md) [Data Shaping Overview](../../../ado/guide/data/data-shaping-overview.md) [Required Providers for Data Shaping](../../../ado/guide/data/required-providers-for-data-shaping.md) [Shape APPEND Clause](../../../ado/guide/data/shape-append-clause.md) [Shape Commands in General](../../../ado/guide/data/shape-commands-in-general.md) [Shape COMPUTE Clause](../../../ado/guide/data/shape-compute-clause.md) [Visual Basic for Applications functions](../../../ado/guide/data/visual-basic-for-applications-functions.md)