Member Junction
    Preparing search index...

    Result of analyzing a SQL string for top-level ORDER BY clauses.

    interface OrderByAnalysis {
        IsLegalInCTE: boolean;
        OrderByClause: string | null;
        Positions: number[];
        SqlWithoutOrderBy: string;
    }
    Index

    Properties

    IsLegalInCTE: boolean

    Whether the ORDER BY is legal in CTE context (TOP, OFFSET, or FOR XML present)

    OrderByClause: string | null

    The extracted ORDER BY clause text (everything after "ORDER BY "), or null if none

    Positions: number[]

    Character positions of all top-level ORDER BY keywords in the original SQL

    SqlWithoutOrderBy: string

    SQL with the last top-level ORDER BY clause stripped (or original if none found)