Today.. Polite SQL Server manners..
1. Use a consistent naming convention
Pretty obvious rule, this one.. Best to try and stick to a common SQL syntax too…
2. Indexes: use them
Why, oh why does it take so long to query 100,000 rows?
3. Keep the place tidy: remove unused Stored Procs
Unless you like piling the kitchen sink high with dirty dishes, remove old procs when you’re done.
4. Roles: Use them
5. If I find "SELECT * FROM.." I’ll kill you
OK, there are some times where you have to use this (maybe) but there is no excuse for being lazy
6. OUTER JOIN: Learn how to use it instead of subqueries
Subqueries are performance hogs.. learn SQL and how an outer join or cartesian join works
7. Implement proper security!
Seriously, do you leave your ATM card and PIN lying around.. together?? Why do everything via sa with no password?
8. Always follow the rules
These rules will keep you safe and productive. Respect others who need to use (and understand what you’re doing).
Also, have some consideration for the humble sods who have to maintain and backup databases.
There are a bunch of other things, but they’re more ‘guidelines’.. Maybe for another rainy day..
Tell me what you think….