SQL Server Performance

Design to handle dynamic build queries with good performance..

Discussion in 'SQL Server 2005 T-SQL Performance Tuning' started by Ritu, Mar 19, 2008.

  1. Ritu New Member

    Hi ,
    We have to design an application in which front end needs to have flexiblity to design queries at runtime and execute against the database.
    Business users will see columnns for the select list and fthe filter list (where clause). So what is best way to handle this situation from the performance and design perspective.
  2. Adriaan New Member

    Check out the articles on performance audit from the main page of this site, and follow the ground rules for proper object references in T-SQL.
    Probably the best option is to execute all queries using sp_ExecuteSQL, with proper parameters for the filter values. This bridges the gap between ad-hoc queries and stored procedures, since it gives SQL a better chance of finding a fitting execution plan, compared to when the actual filter values are included in the query statement itself.

Share This Page