Key Points while writing Query in SQL

May 28 2012 8:18 PM

1. Use dbo. before the Tables.

2. Use Declare Tables instead of Temporary Tables

3. Use INDEX's respectively.

4. Use the Constraints correctly for table.

5. Follow the DataModel perfectly and avoid the redundancy and duplicate data.

6. Use WITH(NOLOCK) for tables in query for avoiding Dead Locks.

7. Use EXISTS instead of INNER JOIN, if possible.


Answers (3)