All reserved words of every DBMS [closed]

别等时光非礼了梦想. 提交于 2019-11-27 03:18:37

问题


I'm designing a database. Now it's on MySQL, but tomorrow could migrate on another DBMS. So I have to pay attention not to use reserved words (for MySQL and possibly for any other DBMS) as field names. And I don't want to use reserved word as field names, wrapped in quotes or square brackets!

Is there a site where I can find all reserved words for every DBMS? Or at least for the most used ones. It would be great if would exist a tool where you put a word and it gives you all DBMS for which it is a reserved word, if any.

If there is no online reference or tool of this kind, we could recollect a list of links for the pages of reserved words of every DBMS. Thanks a lot!


回答1:


WOW... I found this online tool: Reserved Word Search.

It's valid both for DBMS and programming languages. It seems quite up-to-date.




回答2:


Yes. I found this site has an on-line tool to check if the entered word is the reserved word of SQL Server, MySQL, PostgreSQL, Oracle, and DB2 etc.: SQL Reserved Words Checker.

But it seems that its data is not updated to the latest version .You may collect the reserved words for different database 's latest version and build your own "reserved word" database.

This is the official reserved words list for some main databases :

  • Oracle 11g

The V$RESERVED_WORDS data dictionary view provides additional information on all keywords, including whether the keyword is always reserved or is reserved only for particular uses. Please refer to Oracle Database Reference for more information.

  • MySQL 5.5

  • SQL Server 2008 R2

  • PostgreSQL




回答3:


Here is another page, where you can check if some word match reserved word in SQL Server, MySQL, PostgreSQL, Oracle, DB2, ANSI SQL or ODBC:

SQL Reserved Word Checker




回答4:


There are also these pages from Mimer website: SQL Reserved Words Overview and Vendor-reserved Words

And a long list of reserved SQL keywords from Drupal site.




回答5:


This Drupal.org site made a partial list of over 800 words.



来源:https://stackoverflow.com/questions/8339396/all-reserved-words-of-every-dbms

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!