Database Reference
In-Depth Information
3.4.1 Representing Entities
When representing entities with tables created in Windows Azure SQL Database, you need to
follow the naming rules for identiiers used in T-SQL. he rules for naming tables, columns, or
other database objects are listed below:
A name can include up to 128 characters, numbers, or symbols.
A name must start with one of [a-z], [A-Z],_ , @, #, or letter characters from other non-
English languages deined by Unicode Standard 2.0.
he subsequent symbols can be the combination of [a-z], [A-Z], #, @, $,_ , numbers, or letter
characters from other non-English languages deined by Unicode Standard 2.0.
A name cannot use a reserved key word such as System for an object.
An object name cannot use embedded spaces except for a database.
If you have to use names that do not follow these rules, delimit these names with either double
quotation marks “ ” or brackets [] when you use them in your programming code. For example, if
you have to use a table name such as CLASS FACULTY in the code, you must reference it in an
SQL statement as [CLASS FACULTY] or “CLASS FACULTY.”
When an object name starts with the symbols # or @, the name has a special meaning. For
example
A name that starts with the symbol @ represents a local variable or parameter.
A name that starts with the symbol # represents a temporary table or procedure.
A name that starts with the symbol ## or @@ represents a global temporary object.
To be consistent in a database development process, the naming rules or naming convention
should be established before a database development process starts. Everyone in the development
team should follow the naming rules. he examples of the naming rules in this topic are listed in
Table 3.12. All the database objects in this topic will be named with these rules.
Each development team may have its own naming convention. It is important to keep the
naming convention consistent and not conlict with the business rules. Even though you may
be able to include spaces in an identiier's name, it is not a good idea to use a space or a reserved
key word to name database objects except the name of a database. It may cause confusion when
executing programming code.
Table 3.12
Naming Convention
Database Object
Naming Example
Database
Computer Service or
ComputerService
Table
CLASSFACULTY or
CLASS_FACULTY
Intersection table
CLASS_CLASSROOM
Column
StudentID
Search WWH ::




Custom Search