Nigel Rivett wrote:
http://www.mindsdoor.net/SQLAdmin/BadThings.html
Nigel Rivett
www.nigelrivett.net
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Here's a list of my own that I try and preach wherever possible:
Always use a SARG (Search ARGument) in a WHERE clause.
Avoid using the "LIKE" operator with no wildcard.
Don't use the HAVING clause on table columns - use WHERE. (Reserve
HAVING for aggregates)
Use >= instead of > , especially if data contains large number of
duplicate values.
Avoid use of SELECT * FROM ...
Don't Use Cursors! Use a WHILE loop instead.
Avoid use of !=, <> and 'not' operators where possible.
Don't use huge IN clauses.
Don't use DISTINCT in a UNION.
Don't use functions on table columns in WHERE clauses.
Avoid mismatched datatypes in WHERE and join clauses.
Avoid using derived tables where large rowsets are involved - you can't
index derived tables.
Beware of unknown run-time values in WHERE clauses - may result in
tablescans.