Technology with opinion

Wednesday, September 07, 2005

Best Practices: SQL Server

  1. Casing for SQL Server objects should be similar to that of .Net: Public members (tables, sprocs, views, columns) Pascal cased & Private members camel cased
  2. Use Store Procedures everywhere possible
  3. Document and model all security access to database objects that need to be granted, then write the script for this
  4. Write scripts by hand using a text editor (Query Analyzer, UltraEdit, TextPad, VisualStudio.Net) or an intelligent tool such as Erwin
  5. Avoid triggers and give much thought to how you write them if you write them as they can have bad side effects
  6. Avoid using cursors within your stored procedures as logical code such as this should normally be performed in your application (middle) tier not your database tier
  7. Use source code control

No comments: