许多人在编写程序的时候因为贪图方便或不小心使用到程式的保留字,有时明明程序没有错,就是无法正确执行。您知道有哪些常见的保留字吗?
下面的都是编程程序与表名都不能使用,如果不小心使用了,就需要下面的方法解决下
当用USER作为数据库表名时,出错的解决办法
1.因为User是关键字,所以更改表名即可解决。
2.如果不想更改表名,那么我们在操作此表时,不能用User,而应该用[User],例如:
SELECT UserName FROM [User] WHERE UserId = 1
INSERT INTO [User](UserName,PassWord) VALUES('admin','admin')。
Microsoft Access
保留字
-A
ADD
ALL
Alphanumeric
ALTER
AND
ANY
Application
AS
ASC
Assistant
AUTOINCREMENT
Avg
-B
BETWEEN
BINARY
BIT
BOOLEAN
BY
BYTE
-C
CHAR, CHARACTER
COLUMN
CompactDatabase
CONSTRAINT
Container
Count
COUNTER
CREATE
CreateDatabase
CreateField
CreateGroup
CreateIndex
CreateObject
CreateProperty
CreateRelation
CreateTableDef
CreateUser
CreateWorkspace
CURRENCY
CurrentUser
-D
DATABASE
DATE
DATETIME
DELETE
DESC
Description
DISALLOW
DISTINCT
DISTINCTROW
Document
DOUBLE
DROP
-E
Echo
Else
End
Eqv
Error
EXISTS
Exit
-F
FALSE
Field, Fields
FillCache
FLOAT, FLOAT4, FLOAT8
FOREIGN
Form, Forms
FROM
Full
FUNCTION
-G
GENERAL
GetObject
GetOption
GotoPage
GROUP
GROUP BY
GUID
-H
HAVING
-I
Idle
IEEEDOUBLE, IEEESINGLE
If
IGNORE
Imp
IN, In
INDEX
Index, Indexes
INNER
INSERT
InsertText
INT, INTEGER, INTEGER1, INTEGER2, INTEGER4
INTO
IS, Is
-J
JOIN
-K
KEY
-L
LEFT
Level
Like
LOGICAL, LOGICAL1
LONG, LONGBINARY, LONGTEXT
-M
Macro
Match
Max, Min, Mod
MEMO
Module
MONEY
Move
-N
NAME
NewPassword
NO
Not
NULL
NUMBER, NUMERIC
-O
Object
OLEOBJECT
OFF
ON
OpenRecordset
OPTION
OR, Or
ORDER
Outer
OWNERACCESS
-P
Parameter
PARAMETERS
Partial
PERCENT
PIVOT
PRIMARY
PROCEDURE
Property
-Q
Queries
Query
Quit
-R
REAL
Recalc
Recordset
REFERENCES
Refresh
RefreshLink
RegisterDatabase
Relation
Repaint
RepairDatabase
Report
Reports
Requery
RIGHT
-S
SCREEN
SECTION
SELECT)
SET
SetFocus
SetOption
SHORT
SINGLE
SMALLINT
SOME
SQL
StDev, StDevP
STRING
Sum
-T
TABLE
TableDef, TableDefs
TableID
TEXT
TIME, TIMESTAMP
TOP
TRANSFORM
TRUE
Type
-U
UNION
UNIQUE
UPDATE
User
-V
VALUE
VALUES
Var, VarP
VARBINARY, VARCHAR
-W
WHERE
WITH
Workspace
-X
Xor
-Y
Year
YES
YESNO
MySQL
ADD
ALL
ALTER
ANALYZE
AND
AS
ASC
AUTO_INCREMENT
BDB
BERKELEYDB
BETWEEN
BIGINT
BINARY
BLOB
BOTH
BY
CASCADE
CASE
CHANGE
CHAR
CHARACTER
COLUMN
COLUMNS
CONSTRAINT
CREATE
CROSS
CURRENT_DATE
CURRENT_TIME
CURRENT_TIMESTAMP
DATABASE
DATABASES
DAY_HOUR
DAY_MINUTE
DAY_SECOND
DEC DECIMAL
DEFAULT
DELAYED
DELETE
DESC
DESCRIBE
DISTINCT
DISTINCTROW
DOUBLE
DROP
ELSE
ENCLOSED
ESCAPED
EXISTS
EXPLAIN
FIELDS
FLOAT
FOR
FOREIGN
FROM
FULLTEXT
FUNCTION
GRANT
GROUP
HAVING
HIGH_PRIORITY
HOUR_MINUTE
HOUR_SECOND
IF
IGNORE
IN
INDEX
INFILE
INNER
INNODB
INSERT
INT
INTEGER
INTERVAL
INTO
IS JOIN
KEY
KEYS
KILL
LEADING
LEFT
LIKE
LIMIT
LINES
LOAD
LOCK
LONG
LONGBLOB
LONGTEXT
LOW_PRIORITY
MASTER_SERVER_ID MATCH
MEDIUMBLOB
MEDIUMINT
MEDIUMTEXT
MIDDLEINT
MINUTE_SECOND
MRG_MYISAM
NATURAL
NOT
NULL
NUMERIC
ON
OPTIMIZE
OPTION
OPTIONALLY
OR
ORDER
OUTER
OUTFILE
PARTIAL
PRECISION
PRIMARY
PRIVILEGES
PROCEDURE
PURGE
READ
REAL
REFERENCES
REGEXP
RENAME
REPLACE
REQUIRE
RESTRICT
RETURNS
REVOKE
RIGHT
RLIKE
SELECT
SET
SHOW
SMALLINT
SONAME
SQL_BIG_RESULT
SQL_CALC_FOUND_ROWS SQL_SMALL_RESULT
SSL
STARTING
STRAIGHT_JOIN STRIPED
TABLE
TABLES
TERMINATED
THEN
TINYBLOB
TINYINT
TINYTEXT
TO
TRAILING
UNION
UNIQUE
UNLOCK
UNSIGNED
UPDATE
USAGE
USE
USER_RESOURCES
USING
VALUES
VARBINARY
VARCHAR
VARYING
WHEN
WHERE
WITH
WRITE
XOR
YEAR_MONTH
ZEROFILL
下面的都是编程程序与表名都不能使用,如果不小心使用了,就需要下面的方法解决下
当用USER作为数据库表名时,出错的解决办法
1.因为User是关键字,所以更改表名即可解决。
2.如果不想更改表名,那么我们在操作此表时,不能用User,而应该用[User],例如:
SELECT UserName FROM [User] WHERE UserId = 1
INSERT INTO [User](UserName,PassWord) VALUES('admin','admin')。
Microsoft Access
保留字
-A
ADD
ALL
Alphanumeric
ALTER
AND
ANY
Application
AS
ASC
Assistant
AUTOINCREMENT
Avg
-B
BETWEEN
BINARY
BIT
BOOLEAN
BY
BYTE
-C
CHAR, CHARACTER
COLUMN
CompactDatabase
CONSTRAINT
Container
Count
COUNTER
CREATE
CreateDatabase
CreateField
CreateGroup
CreateIndex
CreateObject
CreateProperty
CreateRelation
CreateTableDef
CreateUser
CreateWorkspace
CURRENCY
CurrentUser
-D
DATABASE
DATE
DATETIME
DELETE
DESC
Description
DISALLOW
DISTINCT
DISTINCTROW
Document
DOUBLE
DROP
-E
Echo
Else
End
Eqv
Error
EXISTS
Exit
-F
FALSE
Field, Fields
FillCache
FLOAT, FLOAT4, FLOAT8
FOREIGN
Form, Forms
FROM
Full
FUNCTION
-G
GENERAL
GetObject
GetOption
GotoPage
GROUP
GROUP BY
GUID
-H
HAVING
-I
Idle
IEEEDOUBLE, IEEESINGLE
If
IGNORE
Imp
IN, In
INDEX
Index, Indexes
INNER
INSERT
InsertText
INT, INTEGER, INTEGER1, INTEGER2, INTEGER4
INTO
IS, Is
-J
JOIN
-K
KEY
-L
LEFT
Level
Like
LOGICAL, LOGICAL1
LONG, LONGBINARY, LONGTEXT
-M
Macro
Match
Max, Min, Mod
MEMO
Module
MONEY
Move
-N
NAME
NewPassword
NO
Not
NULL
NUMBER, NUMERIC
-O
Object
OLEOBJECT
OFF
ON
OpenRecordset
OPTION
OR, Or
ORDER
Outer
OWNERACCESS
-P
Parameter
PARAMETERS
Partial
PERCENT
PIVOT
PRIMARY
PROCEDURE
Property
-Q
Queries
Query
Quit
-R
REAL
Recalc
Recordset
REFERENCES
Refresh
RefreshLink
RegisterDatabase
Relation
Repaint
RepairDatabase
Report
Reports
Requery
RIGHT
-S
SCREEN
SECTION
SELECT)
SET
SetFocus
SetOption
SHORT
SINGLE
SMALLINT
SOME
SQL
StDev, StDevP
STRING
Sum
-T
TABLE
TableDef, TableDefs
TableID
TEXT
TIME, TIMESTAMP
TOP
TRANSFORM
TRUE
Type
-U
UNION
UNIQUE
UPDATE
User
-V
VALUE
VALUES
Var, VarP
VARBINARY, VARCHAR
-W
WHERE
WITH
Workspace
-X
Xor
-Y
Year
YES
YESNO
MySQL
ADD
ALL
ALTER
ANALYZE
AND
AS
ASC
AUTO_INCREMENT
BDB
BERKELEYDB
BETWEEN
BIGINT
BINARY
BLOB
BOTH
BY
CASCADE
CASE
CHANGE
CHAR
CHARACTER
COLUMN
COLUMNS
CONSTRAINT
CREATE
CROSS
CURRENT_DATE
CURRENT_TIME
CURRENT_TIMESTAMP
DATABASE
DATABASES
DAY_HOUR
DAY_MINUTE
DAY_SECOND
DEC DECIMAL
DEFAULT
DELAYED
DELETE
DESC
DESCRIBE
DISTINCT
DISTINCTROW
DOUBLE
DROP
ELSE
ENCLOSED
ESCAPED
EXISTS
EXPLAIN
FIELDS
FLOAT
FOR
FOREIGN
FROM
FULLTEXT
FUNCTION
GRANT
GROUP
HAVING
HIGH_PRIORITY
HOUR_MINUTE
HOUR_SECOND
IF
IGNORE
IN
INDEX
INFILE
INNER
INNODB
INSERT
INT
INTEGER
INTERVAL
INTO
IS JOIN
KEY
KEYS
KILL
LEADING
LEFT
LIKE
LIMIT
LINES
LOAD
LOCK
LONG
LONGBLOB
LONGTEXT
LOW_PRIORITY
MASTER_SERVER_ID MATCH
MEDIUMBLOB
MEDIUMINT
MEDIUMTEXT
MIDDLEINT
MINUTE_SECOND
MRG_MYISAM
NATURAL
NOT
NULL
NUMERIC
ON
OPTIMIZE
OPTION
OPTIONALLY
OR
ORDER
OUTER
OUTFILE
PARTIAL
PRECISION
PRIMARY
PRIVILEGES
PROCEDURE
PURGE
READ
REAL
REFERENCES
REGEXP
RENAME
REPLACE
REQUIRE
RESTRICT
RETURNS
REVOKE
RIGHT
RLIKE
SELECT
SET
SHOW
SMALLINT
SONAME
SQL_BIG_RESULT
SQL_CALC_FOUND_ROWS SQL_SMALL_RESULT
SSL
STARTING
STRAIGHT_JOIN STRIPED
TABLE
TABLES
TERMINATED
THEN
TINYBLOB
TINYINT
TINYTEXT
TO
TRAILING
UNION
UNIQUE
UNLOCK
UNSIGNED
UPDATE
USAGE
USE
USER_RESOURCES
USING
VALUES
VARBINARY
VARCHAR
VARYING
WHEN
WHERE
WITH
WRITE
XOR
YEAR_MONTH
ZEROFILL
标签:
保留字
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
桃源资源网 Design By www.nqtax.com
暂无“ASP常见的保留字整理(变量与表名注意不能用)”评论...
RTX 5090要首发 性能要翻倍!三星展示GDDR7显存
三星在GTC上展示了专为下一代游戏GPU设计的GDDR7内存。
首次推出的GDDR7内存模块密度为16GB,每个模块容量为2GB。其速度预设为32 Gbps(PAM3),但也可以降至28 Gbps,以提高产量和初始阶段的整体性能和成本效益。
据三星表示,GDDR7内存的能效将提高20%,同时工作电压仅为1.1V,低于标准的1.2V。通过采用更新的封装材料和优化的电路设计,使得在高速运行时的发热量降低,GDDR7的热阻比GDDR6降低了70%。