分享
 
 
 

SQL Server 的保留关键字一览

王朝mssql·作者佚名  2006-01-08
窄屏简体版  字體: |||超大  

SQL Server 保留关键字

Microsoft® SQL Server™ 2000 使用保留关键字定义、操作和访问数据库。保留关键字是 SQL Server 使用的 Transact-SQL 语言语法的一部分,用于分析和理解 Transact-SQL 语句和批处理。尽管在 Transact-SQL 脚本中,使用 SQL Server 保留关键字作为标识符和对象名在语法上是可行的,但规定只能使用分隔标识符。

下表列出了 SQL Server 的保留关键字。

ADD

EXCEPT

PERCENT

ALL

EXEC

PLAN

ALTER

EXECUTE

PRECISION

AND

EXISTS

PRIMARY

ANY

EXIT

PRINT

AS

FETCH

PROC

ASC

FILE

PROCEDURE

AUTHORIZATION

FILLFACTOR

PUBLIC

BACKUP

FOR

RAISERROR

BEGIN

FOREIGN

READ

BETWEEN

FREETEXT

READTEXT

BREAK

FREETEXTTABLE

RECONFIGURE

BROWSE

FROM

REFERENCES

BULK

FULL

REPLICATION

BY

FUNCTION

RESTORE

CASCADE

GOTO

RESTRICT

CASE

GRANT

RETURN

CHECK

GROUP

REVOKE

CHECKPOINT

HAVING

RIGHT

CLOSE

HOLDLOCK

ROLLBACK

CLUSTERED

IDENTITY

ROWCOUNT

COALESCE

IDENTITY_INSERT

ROWGUIDCOL

COLLATE

IDENTITYCOL

RULE

COLUMN

IF

SAVE

COMMIT

IN

SCHEMA

COMPUTE

INDEX

SELECT

CONSTRAINT

INNER

SESSION_USER

CONTAINS

INSERT

SET

CONTAINSTABLE

INTERSECT

SETUSER

CONTINUE

INTO

SHUTDOWN

CONVERT

IS

SOME

CREATE

JOIN

STATISTICS

CROSS

KEY

SYSTEM_USER

CURRENT

KILL

TABLE

CURRENT_DATE

LEFT

TEXTSIZE

CURRENT_TIME

LIKE

THEN

CURRENT_TIMESTAMP

LINENO

TO

CURRENT_USER

LOAD

TOP

CURSOR

NATIONAL

TRAN

DATABASE

NOCHECK

TRANSACTION

DBCC

NONCLUSTERED

TRIGGER

DEALLOCATE

NOT

TRUNCATE

DECLARE

NULL

TSEQUAL

DEFAULT

NULLIF

UNION

DELETE

OF

UNIQUE

DENY

OFF

UPDATE

DESC

OFFSETS

UPDATETEXT

DISK

ON

USE

DISTINCT

OPEN

USER

DISTRIBUTED

OPENDATASOURCE

VALUES

DOUBLE

OPENQUERY

VARYING

DROP

OPENROWSET

VIEW

DUMMY

OPENXML

WAITFOR

DUMP

OPTION

WHEN

ELSE

OR

WHERE

END

ORDER

WHILE

ERRLVL

OUTER

WITH

ESCAPE

OVER

WRITETEXT

另外,SQL-92 标准还定义了保留关键字列表。不要使用 SQL-92 保留关键字作为对象名和标识符。ODBC 保留关键字列表(如下所示)与 SQL-92 保留关键字列表相同。

说明 SQL-92 保留关键字列表有时可能比 SQL Server 限制更多,有时则限制更少。例如,SQL-92 保留关键字列表包含 INT,而 SQL Server 不需要将其区分为保留关键字。

Transact-SQL 保留关键字可用作数据库或数据库对象(如表、列、视图等)的标识符或名称。使用被引用的标识符或分隔标识符。对将保留关键字用作变量和存储过程参数的名称没有限制。

ODBC 保留关键字

保留了下列关键字用于 ODBC 函数调用。这些关键字根本不约束 SQL 语法;然而,为确保与支持核心 SQL 语法的驱动程序兼容,应用程序应避免使用这些关键字。

下面是当前的 ODBC 保留关键字列表。有关更多信息,请参见《Microsoft ODBC 3.0 程序员参考》,第 2 卷,附录 C。

ABSOLUTE

EXEC

OVERLAPS

ACTION

EXECUTE

PAD

ADA

EXISTS

PARTIAL

ADD

EXTERNAL

PASCAL

ALL

EXTRACT

POSITION

ALLOCATE

FALSE

PRECISION

ALTER

FETCH

PREPARE

AND

FIRST

PRESERVE

ANY

FLOAT

PRIMARY

ARE

FOR

PRIOR

AS

FOREIGN

PRIVILEGES

ASC

FORTRAN

PROCEDURE

ASSERTION

FOUND

PUBLIC

AT

FROM

READ

AUTHORIZATION

FULL

REAL

AVG

GET

REFERENCES

BEGIN

GLOBAL

RELATIVE

BETWEEN

GO

RESTRICT

BIT

GOTO

REVOKE

BIT_LENGTH

GRANT

RIGHT

BOTH

GROUP

ROLLBACK

BY

HAVING

ROWS

CASCADE

HOUR

SCHEMA

CASCADED

IDENTITY

SCROLL

CASE

IMMEDIATE

SECOND

CAST

IN

SECTION

CATALOG

INCLUDE

SELECT

CHAR

INDEX

SESSION

CHAR_LENGTH

INDICATOR

SESSION_USER

CHARACTER

INITIALLY

SET

CHARACTER_LENGTH

INNER

SIZE

CHECK

INPUT

SMALLINT

CLOSE

INSENSITIVE

SOME

COALESCE

INSERT

SPACE

COLLATE

INT

SQL

COLLATION

INTEGER

SQLCA

COLUMN

INTERSECT

SQLCODE

COMMIT

INTERVAL

SQLERROR

CONNECT

INTO

SQLSTATE

CONNECTION

IS

SQLWARNING

CONSTRAINT

ISOLATION

SUBSTRING

CONSTRAINTS

JOIN

SUM

CONTINUE

KEY

SYSTEM_USER

CONVERT

LANGUAGE

TABLE

CORRESPONDING

LAST

TEMPORARY

COUNT

LEADING

THEN

CREATE

LEFT

TIME

CROSS

LEVEL

TIMESTAMP

CURRENT

LIKE

TIMEZONE_HOUR

CURRENT_DATE

LOCAL

TIMEZONE_MINUTE

CURRENT_TIME

LOWER

TO

CURRENT_TIMESTAMP

MATCH

TRAILING

CURRENT_USER

MAX

TRANSACTION

CURSOR

MIN

TRANSLATE

DATE

MINUTE

TRANSLATION

DAY

MODULE

TRIM

DEALLOCATE

MONTH

TRUE

DEC

NAMES

UNION

DECIMAL

NATIONAL

UNIQUE

DECLARE

NATURAL

UNKNOWN

DEFAULT

NCHAR

UPDATE

DEFERRABLE

NEXT

UPPER

DEFERRED

NO

USAGE

DELETE

NONE

USER

DESC

NOT

USING

DESCRIBE

NULL

VALUE

DESCRIPTOR

NULLIF

VALUES

DIAGNOSTICS

NUMERIC

VARCHAR

DISCONNECT

OCTET_LENGTH

VARYING

DISTINCT

OF

VIEW

DOMAIN

ON

WHEN

DOUBLE

ONLY

WHENEVER

DROP

OPEN

WHERE

ELSE

OPTION

WITH

END

OR

WORK

END-EXEC

ORDER

WRITE

ESCAPE

OUTER

YEAR

EXCEPT

OUTPUT

ZONE

EXCEPTION

将来的关键字

以下关键字可能会保留在将来的 SQL Server 版本中,作为将来要实现的新特性。注意,不要使用这些关键字作为标识符。

ABSOLUTE

FOUND

PRESERVE

ACTION

FREE

PRIOR

ADMIN

GENERAL

PRIVILEGES

AFTER

GET

READS

AGGREGATE

GLOBAL

REAL

ALIAS

GO

RECURSIVE

ALLOCATE

GROUPING

REF

ARE

HOST

REFERENCING

ARRAY

HOUR

RELATIVE

ASSERTION

IGNORE

RESULT

AT

IMMEDIATE

RETURNS

BEFORE

INDICATOR

ROLE

BINARY

INITIALIZE

ROLLUP

BIT

INITIALLY

ROUTINE

BLOB

INOUT

ROW

BOOLEAN

INPUT

ROWS

BOTH

INT

SAVEPOINT

BREADTH

INTEGER

SCROLL

CALL

INTERVAL

SCOPE

CASCADED

ISOLATION

SEARCH

CAST

ITERATE

SECOND

CATALOG

LANGUAGE

SECTION

CHAR

LARGE

SEQUENCE

CHARACTER

LAST

SESSION

CLASS

LATERAL

SETS

CLOB

LEADING

SIZE

COLLATION

LESS

SMALLINT

COMPLETION

LEVEL

SPACE

CONNECT

LIMIT

SPECIFIC

CONNECTION

LOCAL

SPECIFICTYPE

CONSTRAINTS

LOCALTIME

SQL

CONSTRUCTOR

LOCALTIMESTAMP

SQLEXCEPTION

CORRESPONDING

LOCATOR

SQLSTATE

CUBE

MAP

SQLWARNING

CURRENT_PATH

MATCH

START

CURRENT_ROLE

MINUTE

STATE

CYCLE

MODIFIES

STATEMENT

DATA

MODIFY

STATIC

DATE

MODULE

STRUCTURE

DAY

MONTH

TEMPORARY

DEC

NAMES

TERMINATE

DECIMAL

NATURAL

THAN

DEFERRABLE

NCHAR

TIME

DEFERRED

NCLOB

TIMESTAMP

DEPTH

NEW

TIMEZONE_HOUR

DEREF

NEXT

TIMEZONE_MINUTE

DESCRIBE

NO

TRAILING

DESCRIPTOR

NONE

TRANSLATION

DESTROY

NUMERIC

TREAT

DESTRUCTOR

OBJECT

TRUE

DETERMINISTIC

OLD

UNDER

DICTIONARY

ONLY

UNKNOWN

DIAGNOSTICS

OPERATION

UNNEST

DISCONNECT

ORDINALITY

USAGE

DOMAIN

OUT

USING

DYNAMIC

OUTPUT

VALUE

EACH

PAD

VARCHAR

END-EXEC

PARAMETER

VARIABLE

EQUALS

PARAMETERS

WHENEVER

EVERY

PARTIAL

WITHOUT

EXCEPTION

PATH

WORK

EXTERNAL

POSTFIX

WRITE

FLASE

PREFIX

YEAR

FIRST

PREORDER

ZONE

FLOAT

PREPARE

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有