Tuesday, June 9, 2009

Database checklist

Naming Guidline
-- Setup a standard for table/view/column/stored procedure names
-- Use full name , avoid abbrevations ( yes /no )
-- No underscores
-- Use pascal casing
-- Not more than three characters to name objects
-- If using any prefixes , standardize it
-- DataTypes standardization , GUID vs ID , Varchar minimum 100 length etc
-- Always use primary key
-- Use unique key constraint for other unique columns
-- Specify not null fields
-- Decide on maximum number of columns per table ( i.e. 20 )
-- Cascase delete ( yes / no )
-- No inline t-sql command, use only stored procedures
-- Do not use SELECT * in queries
-- For large table index the columns most commonly used
-- Store sensitive data ( passwords, credit card , ssn etc ) in encrypted format
-- Use Triggers wisely
-- T-SQL command should order the results in case its master data used in Selection Controls like drop down.

Security
-- Use Database roles / Application roles ( read/read-write )
-- Permission should be granted on tables / view , only for stored procedures

Quality
-- Header comment to discribe the purpose of stored procedure and application details
-- Inline comment with in stored procedures

Clean-up
-- Plan for clean-up scripts to move/ delete old data
-- Back up schedules

Articles:
Guidelines

Follow me on Twitter

0 comments: