I sometimes had problems with my stored procedure names field-, table-, view-oder. Example:
SELECT from, to, rate FROM Table1
The problem is that of is a reserved word in SQL-92. You can put the field name in double quotes to fix this, but what if some other db tools want to read your database? This is your database design and it is your mistake if other applications have problems with your db.
There are many other reserved words (~ 300), and we should avoid all of them. If you change the DBMS from manufacturer A to B, your application may crash because some field names are reserved words. A field named PERCENT may work for db oracle, but on MS SQL Server it should be considered as a reserved word.
I have a tool to test my database design for these reserved words; you too?
Here are my rules
- do not use names longer than 32 characters (some DBMSs cannot handle longer names)
- use only az, AZ, 0-9, and underscore (: -;, / &! =? + - not allowed)
- do not start the name with a number
- avoid these reserved words
shmia source share