×

sqlserver 关键字

sql server关键字大全

匿名 匿名 发表于2020-06-09 09:17:14 浏览27 评论0

抢沙发发表评论

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

ADDEXCEPTPERCENT
ALLEXECPLAN
ALTEREXECUTEPRECISION
ANDEXISTSPRIMARY
ANYEXITPRINT
ASFETCHPROC
ASCFILEPROCEDURE
AUTHORIZATIONFILLFACTORPUBLIC
BACKUPFORRAISERROR
BEGINFOREIGNREAD
BETWEENFREETEXTREADTEXT
BREAKFREETEXTTABLERECONFIGURE
BROWSEFROMREFERENCES
BULKFULLREPLICATION
BYFUNCTIONRESTORE
CASCADEGOTORESTRICT
CASEGRANTRETURN
CHECKGROUPREVOKE
CHECKPOINTHAVINGRIGHT
CLOSEHOLDLOCKROLLBACK
CLUSTEREDIDENTITYROWCOUNT
COALESCEIDENTITY_INSERTROWGUIDCOL
COLLATEIDENTITYCOLRULE
COLUMNIFSAVE
COMMITINSCHEMA
COMPUTEINDEXSELECT
CONSTRAINTINNERSESSION_USER
CONTAINSINSERTSET
CONTAINSTABLEINTERSECTSETUSER
CONTINUEINTOSHUTDOWN
CONVERTISSOME
CREATEJOINSTATISTICS
CROSSKEYSYSTEM_USER
CURRENTKILLTABLE
CURRENT_DATELEFTTEXTSIZE
CURRENT_TIMELIKETHEN
CURRENT_TIMESTAMPLINENOTO
CURRENT_USERLOADTOP
CURSORNATIONALTRAN
DATABASENOCHECKTRANSACTION
DBCCNONCLUSTEREDTRIGGER
DEALLOCATENOTTRUNCATE
DECLARENULLTSEQUAL
DEFAULTNULLIFUNION
DELETEOFUNIQUE
DENYOFFUPDATE
DESCOFFSETSUPDATETEXT
DISKONUSE
DISTINCTOPENUSER
DISTRIBUTEDOPENDATASOURCEVALUES
DOUBLEOPENQUERYVARYING
DROPOPENROWSETVIEW
DUMMYOPENXMLWAITFOR
DUMPOPTIONWHEN
ELSEORWHERE
ENDORDERWHILE
ERRLVLOUTERWITH
ESCAPEOVERWRITETEXT


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

 

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

 

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

ODBC 保留关键字

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

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

ABSOLUTEEXECOVERLAPS
ACTIONEXECUTEPAD
ADAEXISTSPARTIAL
ADDEXTERNALPASCAL
ALLEXTRACTPOSITION
ALLOCATEFALSEPRECISION
ALTERFETCHPREPARE
ANDFIRSTPRESERVE
ANYFLOATPRIMARY
AREFORPRIOR
ASFOREIGNPRIVILEGES
ASCFORTRANPROCEDURE
ASSERTIONFOUNDPUBLIC
ATFROMREAD
AUTHORIZATIONFULLREAL
AVGGETREFERENCES
BEGINGLOBALRELATIVE
BETWEENGORESTRICT
BITGOTOREVOKE
BIT_LENGTHGRANTRIGHT
BOTHGROUPROLLBACK
BYHAVINGROWS
CASCADEHOURSCHEMA
CASCADEDIDENTITYSCROLL
CASEIMMEDIATESECOND
CASTINSECTION
CATALOGINCLUDESELECT
CHARINDEXSESSION
CHAR_LENGTHINDICATORSESSION_USER
CHARACTERINITIALLYSET
CHARACTER_LENGTHINNERSIZE
CHECKINPUTSMALLINT
CLOSEINSENSITIVESOME
COALESCEINSERTSPACE
COLLATEINTSQL
COLLATIONINTEGERSQLCA
COLUMNINTERSECTSQLCODE
COMMITINTERVALSQLERROR
CONNECTINTOSQLSTATE
CONNECTIONISSQLWARNING
CONSTRAINTISOLATIONSUBSTRING
CONSTRAINTSJOINSUM
CONTINUEKEYSYSTEM_USER
CONVERTLANGUAGETABLE
CORRESPONDINGLASTTEMPORARY
COUNTLEADINGTHEN
CREATELEFTTIME
CROSSLEVELTIMESTAMP
CURRENTLIKETIMEZONE_HOUR
CURRENT_DATELOCALTIMEZONE_MINUTE
CURRENT_TIMELOWERTO
CURRENT_TIMESTAMPMATCHTRAILING
CURRENT_USERMAXTRANSACTION
CURSORMINTRANSLATE
DATEMINUTETRANSLATION
DAYMODULETRIM
DEALLOCATEMONTHTRUE
DECNAMESUNION
DECIMALNATIONALUNIQUE
DECLARENATURALUNKNOWN
DEFAULTNCHARUPDATE
DEFERRABLENEXTUPPER
DEFERREDNOUSAGE
DELETENONEUSER
DESCNOTUSING
DESCRIBENULLVALUE
DESCRIPTORNULLIFVALUES
DIAGNOSTICSNUMERICVARCHAR
DISCONNECTOCTET_LENGTHVARYING
DISTINCTOFVIEW
DOMAINONWHEN
DOUBLEONLYWHENEVER
DROPOPENWHERE
ELSEOPTIONWITH
ENDORWORK
END-EXECORDERWRITE
ESCAPEOUTERYEAR
EXCEPTOUTPUTZONE
EXCEPTION


将来的关键字

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

 
 
ABSOLUTEFOUNDPRESERVE
ACTIONFREEPRIOR
ADMINGENERALPRIVILEGES
AFTERGETREADS
AGGREGATEGLOBALREAL
ALIASGORECURSIVE
ALLOCATEGROUPINGREF
AREHOSTREFERENCING
ARRAYHOURRELATIVE
ASSERTIONIGNORERESULT
ATIMMEDIATERETURNS
BEFOREINDICATORROLE
BINARYINITIALIZEROLLUP
BITINITIALLYROUTINE
BLOBINOUTROW
BOOLEANINPUTROWS
BOTHINTSAVEPOINT
BREADTHINTEGERSCROLL
CALLINTERVALSCOPE
CASCADEDISOLATIONSEARCH
CASTITERATESECOND
CATALOGLANGUAGESECTION
CHARLARGESEQUENCE
CHARACTERLASTSESSION
CLASSLATERALSETS
CLOBLEADINGSIZE
COLLATIONLESSSMALLINT
COMPLETIONLEVELSPACE
CONNECTLIMITSPECIFIC
CONNECTIONLOCALSPECIFICTYPE
CONSTRAINTSLOCALTIMESQL
CONSTRUCTORLOCALTIMESTAMPSQLEXCEPTION
CORRESPONDINGLOCATORSQLSTATE
CUBEMAPSQLWARNING
CURRENT_PATHMATCHSTART
CURRENT_ROLEMINUTESTATE
CYCLEMODIFIESSTATEMENT
DATAMODIFYSTATIC
DATEMODULESTRUCTURE
DAYMONTHTEMPORARY
DECNAMESTERMINATE
DECIMALNATURALTHAN
DEFERRABLENCHARTIME
DEFERREDNCLOBTIMESTAMP
DEPTHNEWTIMEZONE_HOUR
DEREFNEXTTIMEZONE_MINUTE
DESCRIBENOTRAILING
DESCRIPTORNONETRANSLATION
DESTROYNUMERICTREAT
DESTRUCTOROBJECTTRUE
DETERMINISTICOLDUNDER
DICTIONARYONLYUNKNOWN
DIAGNOSTICSOPERATIONUNNEST
DISCONNECTORDINALITYUSAGE
DOMAINOUTUSING
DYNAMICOUTPUTVALUE
EACHPADVARCHAR
END-EXECPARAMETERVARIABLE
EQUALSPARAMETERSWHENEVER
EVERYPARTIALWITHOUT
EXCEPTIONPATHWORK
EXTERNALPOSTFIXWRITE
FLASEPREFIXYEAR
FIRSTPREORDERZONE
FLOATPREPARE


群贤毕至

访客