Skip to content
This repository was archived by the owner on Feb 6, 2025. It is now read-only.
This repository was archived by the owner on Feb 6, 2025. It is now read-only.

MSSQL maximum identifier length exceeded #824

Open
@bojanserafimov

Description

@bojanserafimov

The maximum identifier (column, alias, or cte name) length in mssql is 128 characters. We currently exceed that limit on queries that are not too crazy in various ways:

  1. Columns exposed in a cte are labelled with "_".join(vertex_path) + "__" + used_column_name. This would exceed the character limit in a query with a deep traversal before a @recurse is used.
  2. In fold scopes we prepend folded_subquery_ to existing mssql identifiers. This can only be a problem if the existing column name is very long. Looks unlikely and low-priority to me.
  3. For table aliases we append _1, _2, etc to an existing table name. This is also unlikely to cause problems, so it's an extremely low-priority issue.

To address the cte column labeling problem, we can simply choose arbitrary or numbered labels. It will work as long as they are unique.

@chewselene please correct me if I'm missing something.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions