Reserved Keywords in SQL Server

The Article lists the Reserved Keywords in SQL Server. The identifiers we give to the database objects like column names and table names etc should not use these words. If you want to use them, then you should always use the Delimited format by enclosing them in square brackets [] or double quotation marks ("")

Reserved Keywords

The following table lists SQL Server reserved keywords. You should avoid using them.

A
ADDALLALTERAND
ANYASASCAUTHORIZATION
B
BACKUPBEGINBETWEENBREAK
BROWSEBULKBY
C
CASCADECASECHECKCHECKPOINT
CLOSECLUSTEREDCOALESCECOLLATE
COLUMNCOMMITCOMPUTECONSTRAINT
CONTAINSCONTAINSTABLECONTINUECONVERT
CREATECROSSCURRENTCURRENT_DATE
CURRENT_TIMECURRENT_TIMESTAMPCURRENT_USERCURSOR
D
DATABASEDBCCDEALLOCATEDECLARE
DEFAULTDELETEDENYDESC
DISKDISTINCTDISTRIBUTEDDOUBLE
DROPDUMP
E
ELSEENDERRLVLESCAPE
EXCEPTEXECEXECUTEEXISTS
EXITEXTERNAL
F
FETCHFILEFILLFACTORFOR
FOREIGNFREETEXTFREETEXTTABLEFROM
FULLFUNCTION
G
GOTOGRANTGROUP
H
HAVINGHOLDLOCK
I
IDENTITYIDENTITY_INSERTIDENTITYCOLIF
ININDEXINNERINSERT
INTERSECTINTOIS
J
JOIN
K
KEYKILL
L
LEFTLIKELINENOLOAD
M
MERGE
N
NATIONALNOCHECKNONCLUSTEREDNOT
NULLNULLIF
O
OFOFFOFFSETSON
OPENOPENDATASOURCEOPENQUERYOPENROWSET
OPENXMLOPTIONORORDER
OUTEROVER
P
PERCENTPIVOTPLANPRECISION
PRIMARYPRINTPROCPROCEDURE
PUBLIC
R
RAISERRORREADREADTEXTRECONFIGURE
REFERENCESREPLICATIONRESTORERESTRICT
RETURNREVERTREVOKERIGHT
ROLLBACKROWCOUNTROWGUIDCOLRULE
S
SAVESCHEMASECURITYAUDITSELECT
SEMANTICKEYPHRASETABLESEMANTICSIMILARITYDETAILSTABLESEMANTICSIMILARITYTABLESESSION_USER
SETSETUSERSHUTDOWNSOME
STATISTICSSYSTEM_USER
T
TABLETABLESAMPLETEXTSIZETHEN
TOTOPTRANTRANSACTION
TRIGGERTRUNCATETRY_CONVERTTSEQUAL
U
UNIONUNIQUEUNPIVOTUPDATE
UPDATETEXTUSEUSER
V
VALUESVARYINGVIEW
W
WAITFORWHENWHEREWHILE
WITHWITHIN GROUPWRITETEXT

Future Keywords

These are the keywords which are you can use as of now. But they may be part of the Reserved Keywords in the future releases of SQL Server

A
ABSOLUTEACTIONADMINAFTER
AGGREGATEALIASALLOCATEARE
ARRAYASENSITIVEASSERTIONASYMMETRIC
ATATOMIC
B
BEFOREBINARYBITBLOB
BOOLEANBOTHBREADTH
C
CALLCALLEDCARDINALITYCASCADED
CASTCATALOGCHARCHARACTER
CLASSCLOBCOLLATIONCOLLECT
COMPLETIONCONDITIONCONNECTCONNECTION
CONSTRAINTSCONSTRUCTORCORRCORRESPONDING
COVAR_POPCOVAR_SAMPCUBECUME_DIST
CURRENT_CATALOGCURRENT_DEFAULT_TRANSFORM_GROUPCURRENT_PATHCURRENT_ROLE
CURRENT_SCHEMACURRENT_TRANSFORM_GROUP_FOR_TYPECYCLE
D
DATADATEDAYDEC
DECIMALDEFERRABLEDEFERREDDEPTH
DEREFDESCRIBEDESCRIPTORDESTROY
DESTRUCTORDETERMINISTICDICTIONARYDIAGNOSTICS
DISCONNECTDOMAINDYNAMIC
E
EACHELEMENTEND-EXECEQUALS
EVERYEXCEPTION
F
FALSEFILTERFIRSTFLOAT
FOUNDFREEFULLTEXTTABLEFUSION
G
GENERALGETGLOBALGO
GROUPING
H
HOLDHOSTHOUR
I
IGNOREIMMEDIATEINDICATORINITIALIZE
INITIALLYINOUTINPUTINT
INTEGERINTERSECTIONINTERVALISOLATION
ITERATE
L
LANGUAGELARGELASTLATERAL
LEADINGLESSLEVELLIKE_REGEX
LIMITLNLOCALLOCALTIME
LOCALTIMESTAMPLOCATOR
M
MAPMATCHMEMBERMETHOD
MINUTEMODMODIFIESMODIFY
MODULEMONTHMULTISET
N
NAMESNATURALNCHARNCLOB
NEWNEXTNONONE
NORMALIZENUMERIC
O
OBJECTOCCURRENCES_REGEXOLDONLY
OPERATIONORDINALITYOUTOVERLAY
OUTPUT
P
PADPARAMETERPARAMETERSPARTIAL
PARTITIONPATHPOSTFIXPREFIX
PREORDERPREPAREPERCENT_RANKPERCENTILE_CONT
PERCENTILE_DISCPOSITION_REGEXPRESERVEPRIOR
PRIVILEGES
R
RANGEREADSREALRECURSIVE
REFREFERENCINGREGR_AVGXREGR_AVGY
REGR_COUNTREGR_INTERCEPTREGR_R2REGR_SLOPE
REGR_SXXREGR_SXYREGR_SYYRELATIVE
RELEASERESULTRETURNSROLE
ROLLUPROUTINEROWROWS
S
SAVEPOINTSCROLLSCOPESEARCH
SECONDSECTIONSENSITIVESEQUENCE
SESSIONSETSSIMILARSIZE
SMALLINTSPACESPECIFICSPECIFICTYPE
SQLSQLEXCEPTIONSQLSTATESQLWARNING
STARTSTATESTATEMENTSTATIC
STDDEV_POPSTDDEV_SAMPSTRUCTURESUBMULTISET
SUBSTRING_REGEXSYMMETRICSYSTEM
T
TEMPORARYTERMINATETHANTIME
TIMESTAMPTIMEZONE_HOURTIMEZONE_MINUTETRAILING
TRANSLATE_REGEXTRANSLATIONTREATTRUE
U
UESCAPEUNDERUNKNOWNUNNEST
USAGEUSING
V
VALUEVAR_POPVAR_SAMPVARCHAR
VARIABLE
W
WHENEVERWIDTH_BUCKETWITHOUTWINDOW
WITHINWORKWRITE
X
XMLAGGXMLATTRIBUTESXMLBINARYXMLCAST
XMLCOMMENTXMLCONCATXMLDOCUMENTXMLELEMENT
XMLEXISTSXMLFORESTXMLITERATEXMLNAMESPACES
XMLPARSEXMLPIXMLQUERYXMLSERIALIZE
XMLTABLEXMLTEXTXMLVALIDATE
Y
YEAR
Z
ZONE

ODBC Reserved Keywords

These are reserved Keywords from the ODBC function calls. You can use it, but it is better to avoid them as they may be incompatible when using the the ODBC Drivers

A
ABSOLUTEACTIONADAADD
ALLALLOCATEALTERAND
ANYAREASASC
ASSERTIONATAUTHORIZATIONAVG
B
BEGINBETWEENBITBIT_LENGTH
BOTHBY
C
CASCADECASCADEDCASECAST
CATALOGCHARCHAR_LENGTHCHARACTER
CHARACTER_LENGTHCHECKCLOSECOALESCE
COLLATECOLLATIONCOLUMNCOMMIT
CONNECTCONNECTIONCONSTRAINTCONSTRAINTS
CONTINUECONVERTCORRESPONDINGCOUNT
CREATECROSSCURRENTCURRENT_DATE
CURRENT_TIMECURRENT_TIMESTAMPCURRENT_USERCURSOR
D
DATEDAYDEALLOCATEDEC
DECIMALDECLAREDEFAULTDEFERRABLE
DEFERREDDELETEDESCDESCRIBE
DESCRIPTORDIAGNOSTICSDISCONNECTDISTINCT
DOMAINDOUBLEDROP
E
ELSEENDEND-EXECESCAPE
EXCEPTEXCEPTIONEXECEXECUTE
EXISTSEXTERNALEXTRACT
F
FALSEFETCHFIRSTFLOAT
FORFOREIGNFORTRANFOUND
FROMFULL
G
GETGLOBALGOGOTO
GRANTGROUP
H
HAVINGHOUR
I
IDENTITYIMMEDIATEININCLUDE
INDEXINDICATORINITIALLYINNER
INPUTINSENSITIVEINSERTINT
INTEGERINTERSECTINTERVALINTO
ISISOLATION
J
JOIN
K
KEY
L
LANGUAGELASTLEADINGLEFT
LEVELLIKELOCALLOWER
M
MATCHMAXMINMINUTE
MODULEMONTH
N
NAMESNATIONALNATURALNCHAR
NEXTNONONENOT
NULLNULLIFNUMERIC
O
OCTET_LENGTHOFONONLY
OPENOPTIONORORDER
OUTEROUTPUTOVERLAPS
P
PADPARTIALPASCALPOSITION
PRECISIONPREPAREPRESERVEPRIMARY
PRIORPRIVILEGESPROCEDUREPUBLIC
R
READREALREFERENCESRELATIVE
RESTRICTREVOKERIGHTROLLBACK
ROWS
S
SCHEMASCROLLSECONDSECTION
SELECTSESSIONSESSION_USERSET
SIZESMALLINTSOMESPACE
SQLSQLCASQLCODESQLERROR
SQLSTATESQLWARNINGSUBSTRINGSUM
SYSTEM_USER
T
TABLETEMPORARYTHENTIME
TIMESTAMPTIMEZONE_HOURTIMEZONE_MINUTETO
TRAILINGTRANSACTIONTRANSLATETRANSLATION
TRIMTRUE
U
UNIONUNIQUEUNKNOWNUPDATE
UPPERUSAGEUSERUSING
V
VALUEVALUESVARCHARVARYING
VIEW
W
WHENWHENEVERWHEREWITH
WORKWRITE
Y
YEAR
Z
ZONE

References

Transact-SQL Reserved Keywords

1 thought on “Reserved Keywords in SQL Server”

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top