On 2017/11/11 1:04 PM, Bart Smissaert wrote:
What are the exact rules for valid identifier names (tables, columns and
This is both for names enclosed in square brackets () or double quotes
(") and also for names
that are not enclosed within square brackets or double quotes.
The question is phrased quite generally, but if you perhaps meant w.r.t.
SQLite specifically - It's quite straight forward:
An Identifier can be any text, including non-standard characters
(Unicode Chinese etc.) and including no text at all (empty string) as
long as it is quoted with Identifier-compatible quotation marks.
Valid Identifier Quotation characters are: [, ], ` and "
Further to this, an Identifier can remain unquoted (plain text), except:
- when it is empty text or
- when it contains any characters outside the ASCII Alpha-numeric
characters and Underscore, or
- when it starts with a number (digit), or (Suddenly not 100% sure of
this, may need to check it)
- when it is the same as an SQLite Keyword.
Further to this, SQLite will be very forgiving if you use the wrong type
of quotes in some circumstances (where the intention is obvious), or
have an identifier that is the same as a keyword but you only use it in
a phrase where the keyword can't possibly be found.
Read more about it here:
sqlite-users mailing list