SQL Server Reserved Keywords
Microsoft® SQL ServerTM 2000 uses preserved keyword definitions, operation, and access to the database. Key Keywords are part of the Transact-SQL language syntax used by SQL Server, used to analyze and understand Transact-SQL statements and batch. Although in the Transact-SQL script, use SQL Server reserves the keyword as an identifier and object name in grammar, but the rule can only use the separator identifier.
The following table lists the preserved keywords for SQL Server.
ADDEXCEPTPERCENTALLEXECPLANALTEREXECUTEPRECISIONANDEXISTSPRIMARYANYEXITPRINTASFETCHPROCASCFILEPROCEDUREAUTHORIZATIONFILLFACTORPUBLICBACKUPFORRAISERRORBEGINFOREIGNREADBETWEENFREETEXTREADTEXTBREAKFREETEXTTABLERECONFIGUREBROWSEFROMREFERENCESBULKFULLREPLICATIONBYFUNCTIONRESTORECASCADEGOTORESTRICTCASEGRANTRETURNCHECKGROUPREVOKECHECKPOINTHAVINGRIGHTCLOSEHOLDLOCKROLLBACKCLUSTEREDIDENTITYROWCOUNTCOALESCEIDENTITY_INSERTROWGUIDCOLCOLLATEIDENTITYCOLRULECOLUMNIFSAVECOMMITINSCHEMACOMPUTEINDEXSELECTCONSTRAINTINNERSESSION_USERCONTAINSINSERTSETCONTAINSTABLEINTERSECTSETUSERCONTINUEINTOSHUTDOWNCONVERTISSOMECREATEJOINSTATISTICSCROSSKEYSYSTEM_USERCURRENTKILLTABLECURRENT_DATELEFTTEXTSIZECURRENT_TIMELIKETHENCURRENT_TIMESTAMPLINENOTOCURRENT_USERLOADTOPCURSORNATIONALTRANDATABASENOCHECKTRANSACTIONDBCCNONCLUSTEREDTRIGGERDEALLOCATENOTTRUNCATEDECLARENULLTSEQUALDEFAULTNULLIFUNIONDELETEOFUNIQUEDENYOFFUPDATEDESCOFFSETSUPDATETEXTDISKONUSEDISTINCTOPENUSERDISTRIBUTEDOPENDATASOURCEVALUESDOUBLEOPENQUERYVARYINGDROPOPENROW SetViewDumMyopenxmlwaitfordumpOptionwhenelseorwhereEndOrderwhilerrlvlouterwithescapeOverWrittext
In addition, SQL-92 standard also defines a list of reserved keywords. Do not use SQL-92 to keep keywords as object names and identifiers. The ODBC reserves the keyword list (as shown below) is the same as the SQL-92 reserved keyword list.
Note SQL-92 keeps a list of keywords may sometimes limit more than SQL Server, sometimes less. For example, SQL-92 reserves the keyword list contains int, and SQL Server does not need to distinguish it into preserved keywords.
Transact-SQL reserves keywords or names that can be used as database or database objects (such as tables, columns, views, etc.). Use the referenced identifier or the separator. There is no limit to the name of the reserved keyword as a variable and stored procedure parameters.
ODBC keeps keywords
The following keywords have been kept used for ODBC function calls. These keywords do not restrain the SQL syntax; however, applications should avoid using these keywords to ensure that drivers supporting the core SQL syntax. Below is the current ODBC preserved keyword list. For more information, see "Microsoft ODBC 3.0 Programmer Reference", Volume 2, Appendix C.
ABSOLUTEEXECOVERLAPSACTIONEXECUTEPADADAEXISTSPARTIALADDEXTERNALPASCALALLEXTRACTPOSITIONALLOCATEFALSEPRECISIONALTERFETCHPREPAREANDFIRSTPRESERVEANYFLOATPRIMARYAREFORPRIORASFOREIGNPRIVILEGESASCFORTRANPROCEDUREASSERTIONFOUNDPUBLICATFROMREADAUTHORIZATIONFULLREALAVGGETREFERENCESBEGINGLOBALRELATIVEBETWEENGORESTRICTBITGOTOREVOKEBIT_LENGTHGRANTRIGHTBOTHGROUPROLLBACKBYHAVINGROWSCASCADEHOURSCHEMACASCADEDIDENTITYSCROLLCASEIMMEDIATESECONDCASTINSECTIONCATALOGINCLUDESELECTCHARINDEXSESSIONCHAR_LENGTHINDICATORSESSION_USERCHARACTERINITIALLYSETCHARACTER_LENGTHINNERSIZECHECKINPUTSMALLINTCLOSEINSENSITIVESOMECOALESCEINSERTSPACECOLLATEINTSQLCOLLATIONINTEGERSQLCACOLUMNINTERSECTSQLCODECOMMITINTERVALSQLERRORCONNECTINTOSQLSTATECONNECTIONISSQLWARNINGCONSTRAINTISOLATIONSUBSTRINGCONSTRAINTSJOINSUMCONTINUEKEYSYSTEM_USERCONVERTLANGUAGETABLECORRESPONDINGLASTTEMPORARYCOUNTLEADINGTHENCREATELEFTTIMECROSSLEVELTIMESTAMPCURRENTLIKETIMEZONE_HOURCURRENT_DATELOCALTIMEZONE_MINUTECURRENT_TIMELOWERTOCURRENT_TIMESTAMPMATCHTRAILING CURRENT_USERMAXTRANSACTIONCURSORMINTRANSLATEDATEMINUTETRANSLATIONDAYMODULETRIMDEALLOCATEMONTHTRUEDECNAMESUNIONDECIMALNATIONALUNIQUEDECLARENATURALUNKNOWNDEFAULTNCHARUPDATEDEFERRABLENEXTUPPERDEFERREDNOUSAGEDELETENONEUSERDESCNOTUSINGDESCRIBENULLVALUEDESCRIPTORNULLIFVALUESDIAGNOSTICSNUMERICVARCHARDISCONNECTOCTET_LENGTHVARYINGDISTINCTOFVIEWDOMAINONWHENDOUBLEONLYWHENEVERDROPOPENWHEREELSEOPTIONWITHENDORWORKEND-EXECORDERWRITEESCAPEOUTERYEAREXCEPTOUTPUTZONEEXCEPTION
Future keyword
The following keywords may remain in the future SQL Server versions as new features to be implemented in the future. Note that you do not use these keywords as the identifier.