Зарезервированные слова СУБД

Материал из ISPWiki
Перейти к: навигация, поиск


При разработке структуры базы данных (в именах разных сущностей БД), а также в запросах (например, при именовании псевдонимов полей) к базе данных необходимо избегать использования зарезервированных слов СУБД. Разные СУБД по-разному обходить это ограничение, но если приложение разрабатывается в расчёте на использование разных СУБД, зарезервированные слова использовать не стоит.

Ниже приведен сводный список зарезервированных слов в разных СУБД (MS SQL Server, MySQL, SQLite, MS SQL Server Compact, ODBC):

@@IDENTITY
ABORT
ABSOLUTE
ACTION
ADA
ADD
AFTER
ALL
ALLOCATE
ALTER
ANALYZE
AND
ANY
ARE
AS
ASC
ASSERTION
AT
ATTACH
AUTHORIZATION
AUTO_INCREMENT
AUTOINCREMENT
AVG
BACKUP
BDB
BEFORE
BEGIN
BERKELEYDB
BETWEEN
BIGINT
BINARY
BIT
BIT_LENGTH
BLOB
BOTH
BREAK
BROWSE
BULK
BY
CASCADE
CASCADED
CASE
CAST
CATALOG
CHANGE
CHAR
CHAR_LENGTH
CHARACTER
CHARACTER_LENGTH
CHECK
CHECKPOINT
CLOSE
CLUSTERED
COALESCE
COLLATE
COLLATION
COLUMN
COLUMNS
COMMIT
COMPUTE
CONFLICT
CONNECT
CONNECTION
CONSTRAINT
CONSTRAINTS
CONTAINS
CONTAINSTABLE
CONTINUE
CONVERT
CORRESPONDING
COUNT
CREATE
CROSS
CURRENT
CURRENT_DATE
CURRENT_TIME
CURRENT_TIMESTAMP
CURRENT_USER
CURSOR
DATABASE
DATABASEPASSWORD
DATABASES
DATE
DATEADD
DATEDIFF
DATENAME
DATEPART
DAY
DAY_HOUR
DAY_MINUTE
DAY_SECOND
DBCC
DEALLOCATE
DEC
DECIMAL
DECLARE
DEFAULT
DEFERRABLE
DEFERRED
DELAYED
DELETE
DENY
DESC
DESCRIBE
DESCRIPTOR
DETACH
DIAGNOSTICS
DISCONNECT
DISK
DISTINCT
DISTINCTROW
DISTRIBUTED
DOMAIN
DOUBLE
DROP
DUMP
EACH
ELSE
ENCLOSED
ENCRYPTION
END
END-EXEC
ERRLVL
ESCAPE
ESCAPED
EXCEPT
EXCEPTION
EXCLUSIVE
EXEC
EXECUTE
EXISTS
EXIT
EXPLAIN
EXPRESSION
EXTERNAL
EXTRACT
FAIL
FALSE
FETCH
FIELDS
FILE
FILLFACTOR
FIRST
FLOAT
FOR
FOREIGN
FORTRAN
FOUND
FREETEXT
FREETEXTTABLE
FROM
FULL
FULLTEXT
FUNCTION
GET
GLOB
GLOBAL
GO
GOTO
GRANT
GROUP
HAVING
HIGH_PRIORITY
HOLDLOCK
HOUR
HOUR_MINUTE
HOUR_SECOND
IDENTITY
IDENTITY_INSERT
IDENTITYCOL
IF
IGNORE
IMMEDIATE
IN
INCLUDE
INDEX
INDEXED
INDICATOR
INFILE
INITIALLY
INNER
INNODB
INPUT
INSENSITIVE
INSERT
INSERT_ID
INSTEAD
INT
INTEGER
INTERSECT
INTERVAL
INTO
IS
ISNULL
ISOLATION
JOIN
KEY
KEYS
KILL
LANGUAGE
LAST
LAST_INSERT_ID
LEADING
LEFT
LEVEL
LIKE
LIMIT
LINENO
LINES
LOAD
LOCAL
LOCK
LONG
LONGBLOB
LONGTEXT
LOW_PRIORITY
LOWER
MASTER_SERVER_ID
MATCH
MAX
MEDIUMBLOB
MEDIUMINT
MEDIUMTEXT
MERGE
MIDDLEINT
MIN
MINUTE
MINUTE_SECOND
MODULE
MONTH
MRG_MYISAM
NAMES
NATIONAL
NATURAL
NCHAR
NEXT
NO
NOCHECK
NONCLUSTERED
NONE
NOT
NOTNULL
NULL
NULLIF
NUMERIC
OCTET_LENGTH
OF
OFF
OFFSET
OFFSETS
ON
ONLY
OPEN
OPENDATASOURCE
OPENQUERY
OPENROWSET
OPENXML
OPTIMIZE
OPTION
OPTIONALLY
OR
ORDER
OUTER
OUTFILE
OUTPUT
OVER
OVERLAPS
PAD
PARTIAL
PASCAL
PERCENT
PIVOT
PLAN
POSITION
PRAGMA
PRECISION
PREPARE
PRESERVE
PRIMARY
PRINT
PRIOR
PRIVILEGES
PROC
PROCEDURE
PUBLIC
PURGE
QUERY
RAISE
RAISERROR
READ
READTEXT
REAL
RECONFIGURE
REFERENCES
REGEXP
REINDEX
RELATIVE
RELEASE
RENAME
REPLACE
REPLICATION
REQUIRE
RESTORE
RESTRICT
RETURN
RETURNS
REVERT
REVOKE
RIGHT
RLIKE
ROLLBACK
ROW
ROWCOUNT
ROWGUIDCOL
ROWS
RULE
SAVE
SAVEPOINT
SCHEMA
SCROLL
SECOND
SECTION
SECURITYAUDIT
SELECT
SEMANTICKEYPHRASETABLE
SEMANTICSIMILARITYDETAILSTABLE
SEMANTICSIMILARITYTABLE
SESSION
SESSION_USER
SET
SETUSER
SHOW
SHUTDOWN
SIZE
SMALLINT
SOME
SONAME
SPACE
SQL
SQL_AUTO_IS_NULL
SQL_BIG_RESULT
SQL_BIG_SELECTS
SQL_BIG_TABLES
SQL_BUFFER_RESULT
SQL_CALC_FOUND_ROWS
SQL_LOG_BIN
SQL_LOG_OFF
SQL_LOG_UPDATE
SQL_LOW_PRIORITY_UPDATES
SQL_MAX_JOIN_SIZE
SQL_QUOTE_SHOW_CREATE
SQL_SAFE_UPDATES
SQL_SELECT_LIMIT
SQL_SLAVE_SKIP_COUNTER
SQL_SMALL_RESULT
SQL_WARNINGS
SQLCA
SQLCODE
SQLERROR
SQLSTATE
SQLWARNING
SSL
STARTING
STATISTICS
STRAIGHT_JOIN
STRIPED
SUBSTRING
SUM
SYSTEM_USER
TABLE
TABLES
TABLESAMPLE
TEMP
TEMPORARY
TERMINATED
TEXTSIZE
THEN
TIME
TIMESTAMP
TIMEZONE_HOUR
TIMEZONE_MINUTE
TINYBLOB
TINYINT
TINYTEXT
TO
TOP
TRAILING
TRAN
TRANSACTION
TRANSLATE
TRANSLATION
TRIGGER
TRIM
TRUE
TRUNCATE
TRY_CONVERT
TSEQUAL
UNION
UNIQUE
UNKNOWN
UNLOCK
UNPIVOT
UNSIGNED
UPDATE
UPDATETEXT
UPPER
USAGE
USE
USER
USER_RESOURCES
USING
VACUUM
VALUE
VALUES
VARBINARY
VARCHAR
VARYING
VIEW
VIRTUAL
WAITFOR
WHEN
WHENEVER
WHERE
WHILE
WITH
WITHIN GROUP
WORK
WRITE
WRITETEXT
YEAR
YEAR_MONTH
ZEROFILL
ZONE