Rule

  1. Where possible, areas of common processing must be implemented by procedures. Note: Maximize re-use of pre-parsed statements.
  2. For triggers of any complexity the detailed logic must be coded in procedures which are invoked from within the trigger body.
  3. Object names must not be qualified with the owner name. Note: The statement cannot be run in another schema if the owner is specified.
  4. Whenever an explicit insert statement is used, the list of columns into which data is being inserted must be specified. Note: Insert statements must take the form INSERT INTO table (col1, col2) VALUES (val1,val2).
  5. SELECT * FROM table_name should be avoided. You must explicitly name the columns being selected.
  6. Transact SQL variables holding values for a particular column should be named @<column_name>.
  7. Stored procedure parameters should be named @p_<parameter  name>.
  8. A variable/parameter domain should be evident from the name.