VB Programing support Access Database Microsoft Office VB.Net & SQL Server nev@NevVB.com.au Sydney, Australia (612) 9453-0456 Contact Details 23/02/2012
The goal of a naming standard for database objects is to easily identify the type and purpose of the objects in the database. The naming convention should enable practical, legible, concise, unambiguous and consistent names to be created for database objects. Whatever rules are adopted, consistency in applying the conventions is important. This will save time and effort.
A prefix of "tbl" should be used for each Table. The Tables used in procedures, triggers, views, etc will be easily recognisable. This also makes for consistency between SQL Server and Microsoft Access databases.
Table names should always be singular – use "tblCustomer" instead of "tblCustomers".
Where tables share a schema/database with unrelated tables, the table names should have an additional prefix. For example, a Client table of "My Trading Company" could have a prefix of "tblMtcClient". All the tables for that application will appear together in listings.
Junction tables of many to many relationships should concatenate the names of the tables. "tblDoctor" and "tblPatient" tables should be named tblDoctorPatient".
The primary key Column should include the name of the Table and "ID", for example "CustomerID". Foreign key Columns should have the same name, as the primary key of the parent table. For example, a foreign key of "ClientID" will be the same as the name of primary key for the tblClient table. Multiple Foreign keys may need a descriptor.
The index name should have a prefix of "idx", followed by the Table name and Column Name. The index name could be followed by "U" (unique) or "C" (clustered). For example an index on ProductID of the Product Table could be called, "idx_Product_ProductID_U".
A two letter prefix identifies the constraint type:
This is followed by the Table and Column names, for example fkProductState.
The view should have a prefix of "view". This should be followed by the Table name or purpose of the View.
Use a prefix of "usp" (User Stored Procedure) or three letters to describe the application. Do not use a prefix of "sp_". The prefix should be followed by the name of the Table and a verb describing the operation performed – Create, Read, Update, and Delete.
Use a prefix of "trg" or three letters to describe the application. The prefix should be followed by the name of the Table and a verb describing the operation executed – Insert, Update, or Delete. If the trigger handles more than one operation, include both operations in the name.