欢迎光临
我们一直在努力

SQL Server 的保留关键字一览-数据库专栏,SQL Server

建站超值云服务器,限时71元/月

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

下表列出了 sql server 的保留关键字。
addexceptpercentallexecplanalterexecuteprecisionandexistsprimaryanyexitprintasfetchprocascfileprocedureauthorizationfillfactorpublicbackupforraiserrorbeginforeignreadbetweenfreetextreadtextbreakfreetexttablereconfigurebrowsefromreferencesbulkfullreplicationbyfunctionrestorecascadegotorestrictcasegrantreturncheckgrouprevokecheckpointhavingrightcloseholdlockrollbackclusteredidentityrowcountcoalesceidentity_insertrowguidcolcollateidentitycolrulecolumnifsavecommitinschemacomputeindexselectconstraintinnersession_usercontainsinsertsetcontainstableintersectsetusercontinueintoshutdownconvertissomecreatejoinstatisticscrosskeysystem_usercurrentkilltablecurrent_datelefttextsizecurrent_timelikethencurrent_timestamplinenotocurrent_userloadtopcursornationaltrandatabasenochecktransactiondbccnonclusteredtriggerdeallocatenottruncatedeclarenulltsequaldefaultnullifuniondeleteofuniquedenyoffupdatedescoffsetsupdatetextdiskonusedistinctopenuserdistributedopendatasourcevaluesdoubleopenqueryvaryingdropopenrowsetviewdummyopenxmlwaitfordumpoptionwhenelseorwhereendorderwhileerrlvlouterwithescapeoverwritetext

另外,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。
absoluteexecoverlapsactionexecutepadadaexistspartialaddexternalpascalallextractpositionallocatefalseprecisionalterfetchprepareandfirstpreserveanyfloatprimaryareforpriorasforeignprivilegesascfortranprocedureassertionfoundpublicatfromreadauthorizationfullrealavggetreferencesbeginglobalrelativebetweengorestrictbitgotorevokebit_lengthgrantrightbothgrouprollbackbyhavingrowscascadehourschemacascadedidentityscrollcaseimmediatesecondcastinsectioncatalogincludeselectcharindexsessionchar_lengthindicatorsession_usercharacterinitiallysetcharacter_lengthinnersizecheckinputsmallintcloseinsensitivesomecoalesceinsertspacecollateintsqlcollationintegersqlcacolumnintersectsqlcodecommitintervalsqlerrorconnectintosqlstateconnectionissqlwarningconstraintisolationsubstringconstraintsjoinsumcontinuekeysystem_userconvertlanguagetablecorrespondinglasttemporarycountleadingthencreatelefttimecrossleveltimestampcurrentliketimezone_hourcurrent_datelocaltimezone_minutecurrent_timelowertocurrent_timestampmatchtrailingcurrent_usermaxtransactioncursormintranslatedateminutetranslationdaymoduletrimdeallocatemonthtruedecnamesuniondecimalnationaluniquedeclarenaturalunknowndefaultncharupdatedeferrablenextupperdeferrednousagedeletenoneuserdescnotusingdescribenullvaluedescriptornullifvaluesdiagnosticsnumericvarchardisconnectoctet_lengthvaryingdistinctofviewdomainonwhendoubleonlywheneverdropopenwhereelseoptionwithendorworkend-execorderwriteescapeouteryearexceptoutputzoneexception  
将来的关键字
以下关键字可能会保留在将来的 sql server 版本中,作为将来要实现的新特性。注意,不要使用这些关键字作为标识符。
absolutefoundpreserveactionfreeprioradmingeneralprivilegesaftergetreadsaggregateglobalrealaliasgorecursiveallocategroupingrefarehostreferencingarrayhourrelativeassertionignoreresultatimmediatereturnsbeforeindicatorrolebinaryinitializerollupbitinitiallyroutineblobinoutrowbooleaninputrowsbothintsavepointbreadthintegerscrollcallintervalscopecascadedisolationsearchcastiteratesecondcataloglanguagesectioncharlargesequencecharacterlastsessionclasslateralsetsclobleadingsizecollationlesssmallintcompletionlevelspaceconnectlimitspecificconnectionlocalspecifictypeconstraintslocaltimesqlconstructorlocaltimestampsqlexceptioncorrespondinglocatorsqlstatecubemapsqlwarningcurrent_pathmatchstartcurrent_roleminutestatecyclemodifiesstatementdatamodifystaticdatemodulestructuredaymonthtemporarydecnamesterminatedecimalnaturalthandeferrablenchartimedeferrednclobtimestampdepthnewtimezone_hourderefnexttimezone_minutedescribenotrailingdescriptornonetranslationdestroynumerictreatdestructorobjecttruedeterministicoldunderdictionaryonlyunknowndiagnosticsoperationunnestdisconnectordinalityusagedomainoutusingdynamicoutputvalueeachpadvarcharend-execparametervariableequalsparameterswhenevereverypartialwithoutexceptionpathworkexternalpostfixwriteflaseprefixyearfirstpreorderzonefloatprepare 

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » SQL Server 的保留关键字一览-数据库专栏,SQL Server
分享到: 更多 (0)