Get Adobe Flash player

Triggers and Views Naming Standard

Triggers

Triggers exist in all common database engines.   There are some good reasons to use them.  But in most cases, they are used to fix bad application code.   So a good rule is not to use them.

Simple Name:  <verb> + <Table Name> + trigger + sequence
Example:  InsertUpdateOrderDetailTrigger1

Alternate Name: <verb> + <Table Name> +tr + sequence
Example:  InsertUpdateOrderDetailTr1 Or InsertUpdateOrderDetail_tr2

Views

A view is a pseudo table.  A table that is made of a select statement.  Read Only.   While some database engines allow for update, it is more common to select from it.

There are arguments on how to properly name a view.  Some people say that a view should be prefixed with a “v” or “view”.    Some have a suffix of “S”.  S for plural (i.e. Clients)

For this document we will not have a prefix.  We will have a suffix

For example, we will have a view that will return Orders and the Order Details.    The view name would be called OrdersDetails