T-SQL best practices - 1

Sunday, 20 September 2009

Hi All!...we decided to write some posts on the best practices in writing T-SQL,which we think helpful to the newbies.We will list three best practices each day for the next seven days and hope this series will be helpful to all the readers.So today's best practices tips are,


Document your database
Use Extended properties of the table structures to document the database.
Use tools to generate the documentation and correct where necessary
Maintain the script for populating the extended properties.
Use Cursors only when
You cannot find a set based solution in 4 Hours
You want to utilize already existing logic in other SP
You are writing a database maintenance task
Use STATISTICS IO ON
–This will reduce the logical reads

We need your comments on this post and share the best practices that you are using in the script(related to the above 3 techniques).

2 comments:

Very good initiative Magesh. I will share very soon.

Cegonsoft said...

I am looking for complete SQL and T-SQL training..Are you providing online training for this course?If you providing really helpful for me...