[ACCEPTED]-SQLite table and column name requirements-sqlite
Accepted answer
If you use brackets or quotes you can use 6 any name and there is no restriction :
create table [--This is a_valid.table+name!?] (x int);
But 5 table names that don't have brackets around 4 them should be any alphanumeric combination 3 that doesn't start with a digit and does 2 not contain any spaces.
You can use underline 1 and $ but you can not use symbols like: + - ? ! * @ % ^ & # = / \ : " '
From the sqlite doc,
If you want to use a keyword as a name, you need to quote it. There are four ways of quoting keywords in SQLite:
'keyword' A keyword in single quotes is a string literal.
"keyword" A keyword in double-quotes is an identifier.
[keyword] A keyword enclosed in square brackets is an identifier. This is not standard SQL. This quoting mechanism is used by MS Access and SQL Server and is included in SQLite for compatibility.
`keyword` A keyword enclosed in grave accents (ASCII code 96) is an identifier. This is not standard SQL. This quoting mechanism is used by MySQL and is included in SQLite for compatibility.
So, double quoting the table name 2 and you can use any chars. [tablename]
can be used 1 but not a standard SQL.
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.