How to write optimized queries in SQL SERVER?

Optimizing SQL Queries What things you consider while you write SQL queries. Do You have any checklist for good SQL queries?

Tags..  SQL SERVER  SQL Queries  Database Optimization
Views: 779 | Community Opinion: 1

Add Your Opinion

Bookmark this page..



Ask a New Question Go to Home


Community Opinion/Answers

To achieve performance and scalability of your database you need to create optimized SQL queries. Here is a checklist

Don’t use heavy calculation in SQL Query.
Write correctly formed queries.
Return only the rows and columns needed.
Avoid expensive operators such as NOT LIKE.
Know the performance and scalability characteristics of queries.
Avoid explicit or implicit functions in WHERE clauses.
Use locking and isolation level hints to minimize locking.
Use stored procedures or parameterized queries.
Minimize cursor use.
Avoid long actions in triggers.
Use temporary tables and table variables appropriately.
Limit query and index hints use.
Fully qualify database objects.



What do you think? Add your opinion/answer
Your Name:
*your opinion/answer: