T-SQL best practices - 4

Wednesday, 23 September 2009

- The dynamic SQL Performs slower because the optimizer has to create an execution plan for every execution.


-Use table aliasing, even if there is no joining in the query. Aliasing eliminates ambiguity, eases subsequent modification, and further reduces the chance of a typo not being recognized.

-When querying a table, prefix it with the owner (schema), typically dbo. There is a little performance improvement and query becomes more readable

1 comments:

Raj said...

Your second point is quite new. I wasn't aware of its benefit.

Keep posting things in details like this.


-Raj Singh
http://netraju.blogspot.com