All Tips & Questions

Tip of the day

SQL Server : Disadvantages of dynamic SQL are...

  • Performance loss: the execution plan for a dynamic query cannot be cached.
  • Hard to debug.
  • The error management becomes more unreliable. There is no easy way to validate the dynamic code or control its effects.
  • Temporary tables from the main statement cannot be used, unless they are global.
  • If the algorithm of the main statement has many loops, calculations or slow queries, that time will add up to the time of executing the dynamic code.
  • Maintenance is difficult because the schema is hard coded in the dynamic code. The main statement is harder to understand than regular code because it is necessary to consider how it affects the dynamic code, without seeing it.
  • Security can be compromised with SQL injection.

- by Venkateswarlu Cherukuru

Question of the day

SQL Server : What are the difference between clustered and a non-clustered index?

  • A clustered index is a special type of index that reorders the way records in the table are physically stored. Therefore table can have only one clustered index. The leaf nodes of a clustered index contain the data pages.

  • A non clustered index is a special type of index in which the logical order of the index does not match the physical stored order of the rows on disk. The leaf node of a non clustered index does not consist of the data pages. Instead, the leaf nodes contain index rows.

- by Venkateswarlu Cherukuru


We are inviting Tips & Questions from you. Click Here to share your valuable Tips & Questions on this website.

  • Your Tips & Questions will be displayed on website, after validating the information you provided.
  • Tips & Questions will be refreshed on every day 12:00 AM IST.