以下是SQLSERVER 2008R2安裝以後內建的說明文件定義的保留字

SQL Server uses reserved keywords to define, manipulate, and add databases. Reserved keywords are part of the Transact-SQL grammar that is used by SQL Server to parse and understand Transact-SQL statements and batches.

SQL Server instance names cannot match a reserved keyword. Use the following table to ensure that reserved keywords are not used in SQL Server instance names.

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

Additionally, the ISO standard defines a list of reserved keywords. Avoid using ISO reserved keywords for object names and identifiers. The ODBC reserved keyword list, shown in the following table, is the same as the ISO reserved keyword list.

Note:

The ISO reserved keywords list sometimes can be more restrictive than SQL Server and at other times less restrictive. For example, the ISO reserved keywords list contains INT. SQL Server does not treat INT as a reserved keyword.

ODBC Reserved Keywords

The following words are reserved for use in ODBC function calls. These words do not constrain the minimum SQL grammar. However, to ensure compatibility with drivers that support the core SQL grammar, avoid using these keywords in SQL Server instance names.

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

   

 

The following table contains words reserved for use by Multidimensional Expressions (MDX). You should not use these words as part of any identifier, such as a cube name, or user-defined function name, in MDX.

ABSOLUTE

DESC

LEAVES

SELF_BEFORE_AFTER

ACTIONPARAMETERSET

DESCENDANTS

LEVEL

SESSION

ADDCALCULATEDMEMBERS

DESCRIPTION

LEVELS

SET

AFTER

DIMENSION

LINKMEMBER

SETTOARRAY

AGGREGATE

DIMENSIONS

LINREGINTERCEPT

SETTOSTR

ALL

DISTINCT

LINREGPOINT

SORT

ALLMEMBERS

DISTINCTCOUNT

LINREGR2

STDDEV

ANCESTOR

DRILLDOWNLEVEL

LINREGSLOPE

STDDEVP

ANCESTORS

DRILLDOWNLEVELBOTTOM

LINREGVARIANCE

STDEV

AND

DRILLDOWNLEVELTOP

LOOKUPCUBE

STDEVP

AS

DRILLDOWNMEMBER

MAX

STORAGE

ASC

DRILLDOWNMEMBERBOTTOM

MEASURE

STRIPCALCULATEDMEMBERS

ASCENDANTS

DRILLDOWNMEMBERTOP

MEDIAN

STRTOMEMBER

AVERAGE

DRILLUPLEVEL

MEMBER

STRTOSET

AXIS

DRILLUPMEMBER

MEMBERS

STRTOTUPLE

BASC

DROP

MEMBERTOSTR

STRTOVAL

BDESC

EMPTY

MIN

STRTOVALUE

BEFORE

END

MTD

SUBSET

BEFORE_AND_AFTER

ERROR

NAME

SUM

BOTTOMCOUNT

EXCEPT

NAMETOSET

TAIL

BOTTOMPERCENT

EXCLUDEEMPTY

NEST

THIS

BOTTOMSUM

EXTRACT

NEXTMEMBER

TOGGLEDRILLSTATE

BY

FALSE

NO_ALLOCATION

TOPCOUNT

CACHE

FILTER

NO_PROPERTIES

TOPPERCENT

CALCULATE

FIRSTCHILD

NON

TOPSUM

CALCULATION

FIRSTSIBLING

NONEMPTYCROSSJOIN

TOTALS

CALCULATIONCURRENTPASS

FOR

NOT_RELATED_TO_FACTS

TREE

CALCULATIONPASSVALUE

FREEZE

NULL

TRUE

CALCULATIONS

FROM

ON

TUPLETOSTR

CALL

GENERATE

OPENINGPERIOD

TYPE

CELL

GLOBAL

OR

UNION

CELLFORMULASETLIST

GROUP

PAGES

UNIQUE

CHAPTERS

GROUPING

PARALLELPERIOD

UNIQUENAME

CHILDREN

HEAD

PARENT

UPDATE

CLEAR

HIDDEN

PASS

USE

CLOSINGPERIOD

HIERARCHIZE

PERIODSTODATE

USE_EQUAL_ALLOCATION

COALESCEEMPTY

HIERARCHY

POST

USE_WEIGHTED_ALLOCATION

COLUMN

IGNORE

PREDICT

USE_WEIGHTED_INCREMENT

COLUMNS

IIF

PREVMEMBER

USERNAME

CORRELATION

INCLUDEEMPTY

PROPERTIES

VALIDMEASURE

COUNT

INDEX

PROPERTY

VALUE

COUSIN

INTERSECT

QTD

VAR

COVARIANCE

IS

RANK

VARIANCE

COVARIANCEN

ISANCESTOR

RECURSIVE

VARIANCEP

CREATE

ISEMPTY

RELATIVE

VARP

CREATEPROPERTYSET

ISGENERATION

ROLLUPCHILDREN

VISUAL

CREATEVIRTUALDIMENSION

ISLEAF

ROOT

VISUALTOTALS

CROSSJOIN

ISSIBLING

ROWS

WHERE

CUBE

ITEM

SCOPE

WITH

CURRENT

LAG

SECTIONS

WTD

CURRENTCUBE

LASTCHILD

SELECT

XOR

CURRENTMEMBER

LASTPERIODS

SELF

YTD

DEFAULT_MEMBER

LASTSIBLING

SELF_AND_AFTER

 

DEFAULTMEMBER

LEAD

SELF_AND_BEFORE

 

 


Microsoft SQL Server uses reserved keywords for defining, manipulating, and accessing databases. Reserved keywords are part of the grammar of the Transact-SQL language that is used by SQL Server to parse and understand Transact-SQL statements and batches. Although it is syntactically possible to use SQL Server reserved keywords as identifiers and object names in Transact-SQL scripts, you can do this only by using delimited identifiers.

The following table lists SQL Server reserved keywords.

ADD

EXISTS

PRECISION

ALL

EXIT

PRIMARY

ALTER

EXTERNAL

PRINT

AND

FETCH

PROC

ANY

FILE

PROCEDURE

AS

FILLFACTOR

PUBLIC

ASC

FOR

RAISERROR

AUTHORIZATION

FOREIGN

READ

BACKUP

FREETEXT

READTEXT

BEGIN

FREETEXTTABLE

RECONFIGURE

BETWEEN

FROM

REFERENCES

BREAK

FULL

REPLICATION

BROWSE

FUNCTION

RESTORE

BULK

GOTO

RESTRICT

BY

GRANT

RETURN

CASCADE

GROUP

REVERT

CASE

HAVING

REVOKE

CHECK

HOLDLOCK

RIGHT

CHECKPOINT

IDENTITY

ROLLBACK

CLOSE

IDENTITY_INSERT

ROWCOUNT

CLUSTERED

IDENTITYCOL

ROWGUIDCOL

COALESCE

IF

RULE

COLLATE

IN

SAVE

COLUMN

INDEX

SCHEMA

COMMIT

INNER

SECURITYAUDIT

COMPUTE

INSERT

SELECT

CONSTRAINT

INTERSECT

SESSION_USER

CONTAINS

INTO

SET

CONTAINSTABLE

IS

SETUSER

CONTINUE

JOIN

SHUTDOWN

CONVERT

KEY

SOME

CREATE

KILL

STATISTICS

CROSS

LEFT

SYSTEM_USER

CURRENT

LIKE

TABLE

CURRENT_DATE

LINENO

TABLESAMPLE

CURRENT_TIME

LOAD

TEXTSIZE

CURRENT_TIMESTAMP

MERGE

THEN

CURRENT_USER

NATIONAL

TO

CURSOR

NOCHECK

TOP

DATABASE

NONCLUSTERED

TRAN

DBCC

NOT

TRANSACTION

DEALLOCATE

NULL

TRIGGER

DECLARE

NULLIF

TRUNCATE

DEFAULT

OF

TSEQUAL

DELETE

OFF

UNION

DENY

OFFSETS

UNIQUE

DESC

ON

UNPIVOT

DISK

OPEN

UPDATE

DISTINCT

OPENDATASOURCE

UPDATETEXT

DISTRIBUTED

OPENQUERY

USE

DOUBLE

OPENROWSET

USER

DROP

OPENXML

VALUES

DUMP

OPTION

VARYING

ELSE

OR

VIEW

END

ORDER

WAITFOR

ERRLVL

OUTER

WHEN

ESCAPE

OVER

WHERE

EXCEPT

PERCENT

WHILE

EXEC

PIVOT

WITH

EXECUTE

PLAN

WRITETEXT

Additionally, the ISO standard defines a list of reserved keywords. Avoid using ISO reserved keywords for object names and identifiers. The ODBC reserved keyword list, shown in the following table, is the same as the ISO reserved keyword list.

Note:

The ISO standards reserved keywords list sometimes can be more restrictive than SQL Server and at other times less restrictive. For example, the ISO reserved keywords list contains INT. SQL Server does not have to distinguish this as a reserved keyword.

Transact-SQL reserved keywords can be used as identifiers or names of databases or database objects, such as tables, columns, views, and so on. Use either quoted identifiers or delimited identifiers. Using reserved keywords as the names of variables and stored procedure parameters is not restricted. For more information, see Using Identifiers As Object Names.

ODBC Reserved Keywords

The following words are reserved for use in ODBC function calls. These words do not constrain the minimum SQL grammar; however, to ensure compatibility with drivers that support the core SQL grammar, applications should avoid using these keywords.

This is the current list of ODBC reserved keywords.

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

   

Future Keywords

The following keywords could be reserved in future releases of SQL Server as new features are implemented. Consider avoiding the use of these words as identifiers.

ABSOLUTE

HOST

RELATIVE

ACTION

HOUR

RELEASE

ADMIN

IGNORE

RESULT

AFTER

IMMEDIATE

RETURNS

AGGREGATE

INDICATOR

ROLE

ALIAS

INITIALIZE

ROLLUP

ALLOCATE

INITIALLY

ROUTINE

ARE

INOUT

ROW

ARRAY

INPUT

ROWS

ASENSITIVE

INT

SAVEPOINT

ASSERTION

INTEGER

SCROLL

ASYMMETRIC

INTERSECTION

SCOPE

AT

INTERVAL

SEARCH

ATOMIC

ISOLATION

SECOND

BEFORE

ITERATE

SECTION

BINARY

LANGUAGE

SENSITIVE

BIT

LARGE

SEQUENCE

BLOB

LAST

SESSION

BOOLEAN

LATERAL

SETS

BOTH

LEADING

SIMILAR

BREADTH

LESS

SIZE

CALL

LEVEL

SMALLINT

CALLED

LIKE_REGEX

SPACE

CARDINALITY

LIMIT

SPECIFIC

CASCADED

LN

SPECIFICTYPE

CAST

LOCAL

SQL

CATALOG

LOCALTIME

SQLEXCEPTION

CHAR

LOCALTIMESTAMP

SQLSTATE

CHARACTER

LOCATOR

SQLWARNING

CLASS

MAP

START

CLOB

MATCH

STATE

COLLATION

MEMBER

STATEMENT

COLLECT

METHOD

STATIC

COMPLETION

MINUTE

STDDEV_POP

CONDITION

MOD

STDDEV_SAMP

CONNECT

MODIFIES

STRUCTURE

CONNECTION

MODIFY

SUBMULTISET

CONSTRAINTS

MODULE

SUBSTRING_REGEX

CONSTRUCTOR

MONTH

SYMMETRIC

CORR

MULTISET

SYSTEM

CORRESPONDING

NAMES

TEMPORARY

COVAR_POP

NATURAL

TERMINATE

COVAR_SAMP

NCHAR

THAN

CUBE

NCLOB

TIME

CUME_DIST

NEW

TIMESTAMP

CURRENT_CATALOG

NEXT

TIMEZONE_HOUR

CURRENT_DEFAULT_TRANSFORM_GROUP

NO

TIMEZONE_MINUTE

CURRENT_PATH

NONE

TRAILING

CURRENT_ROLE

NORMALIZE

TRANSLATE_REGEX

CURRENT_SCHEMA

NUMERIC

TRANSLATION

CURRENT_TRANSFORM_GROUP_FOR_TYPE

OBJECT

TREAT

CYCLE

OCCURRENCES_REGEX

TRUE

DATA

OLD

UESCAPE

DATE

ONLY

UNDER

DAY

OPERATION

UNKNOWN

DEC

ORDINALITY

UNNEST

DECIMAL

OUT

USAGE

DEFERRABLE

OVERLAY

USING

DEFERRED

OUTPUT

VALUE

DEPTH

PAD

VAR_POP

DEREF

PARAMETER

VAR_SAMP

DESCRIBE

PARAMETERS

VARCHAR

DESCRIPTOR

PARTIAL

VARIABLE

DESTROY

PARTITION

WHENEVER

DESTRUCTOR

PATH

WIDTH_BUCKET

DETERMINISTIC

POSTFIX

WITHOUT

DICTIONARY

PREFIX

WINDOW

DIAGNOSTICS

PREORDER

WITHIN

DISCONNECT

PREPARE

WORK

DOMAIN

PERCENT_RANK

WRITE

DYNAMIC

PERCENTILE_CONT

XMLAGG

EACH

PERCENTILE_DISC

XMLATTRIBUTES

ELEMENT

POSITION_REGEX

XMLBINARY

END-EXEC

PRESERVE

XMLCAST

EQUALS

PRIOR

XMLCOMMENT

EVERY

PRIVILEGES

XMLCONCAT

EXCEPTION

RANGE

XMLDOCUMENT

FALSE

READS

XMLELEMENT

FILTER

REAL

XMLEXISTS

FIRST

RECURSIVE

XMLFOREST

FLOAT

REF

XMLITERATE

FOUND

REFERENCING

XMLNAMESPACES

FREE

REGR_AVGX

XMLPARSE

FULLTEXTTABLE

REGR_AVGY

XMLPI

FUSION

REGR_COUNT

XMLQUERY

GENERAL

REGR_INTERCEPT

XMLSERIALIZE

GET

REGR_R2

XMLTABLE

GLOBAL

REGR_SLOPE

XMLTEXT

GO

REGR_SXX

XMLVALIDATE

GROUPING

REGR_SXY

YEAR

HOLD

REGR_SYY

ZONE

 

arrow
arrow
    創作者介紹
    創作者 K 的頭像
    K

    K'隨手記

    K 發表在 痞客邦 留言(0) 人氣()