Skip to content

special-chars-in-identifier

SQLstyleno fixdefault: offsql/sqlfluff

Reports a quoted identifier with a space or another character that is not a letter, a digit or an underscore. A column of a select element that has an alias is left alone.

A name with special characters has to be quoted in every query that uses it, and the quotes differ between databases. Tools that generate code from the schema fail on such names.

To fix, rename it with letters, digits and underscores.

Reported
select "a b", "ab", x as "c d" from "my t" as "q r";
sql:
lint:
rules:
special-chars-in-identifier: warn # off (default), warn, error

Enabled by the presets: sql/sqlfluff.

Suppress one line with sudsy-disable-next-line special-chars-in-identifier in a comment of the file’s language.

The same check in other tools; Sudsy reports what each upstream rule reports.

Tool Rule Match
sqlfluff RF05 full