13 July 2014

SQL DB Structure

  • Each table must have a primary key
  • In most cases it should be an IDENTITY column named ID
  • Normalize data to third normal form
  • Do not compromise on performance to reach third normal form. Sometimes, a little de-normalization results in better performance.
  • Do not use TEXT as a data type; use the maximum allowed characters of VARCHAR instead
  • In VARCHAR data columns, do not default to NULL; use an empty string instead
  • Columns with default values should not allow NULLs
  • As much as possible, create stored procedures on the same database as the main tables they will be accessing

No comments: