hi, have a nice day to all , can some expert here point out what are the do and don't when we writing query ? ie:should we create many view as handler to get data? when should we use store procedure and trigger ? and so on
i seeking the way to improve my sql skill, can someone suggest some reference site or material or book as well ?
In general, try to use stored procedures for most/all data access. This goes for reading as well as writing data.
Check samples of your procedures to see if the queries are hitting the indexes as much as feasible (part of this is learning there are some queries that will never benefit from indexes). Query Analyzer will show you an estimated or actual query plan, use it often.
Avoid having views reference other views. This leads to a real support problem, where changing a base view breaks views you may not remember.
I am sure Microsoft has a few whitepapers out there about database design principles. I just can not think of any offhand. Good luck.