1.

Which of the following is a disadvantage of dynamic SQL?(a) Stored procedure can not cache the execution plan for this dynamic query(b) Stored procedure can cache the execution plan for this dynamic query(c) Flexibility in your code that you can not get with standard SQL(d) All of the mentionedThis question was posed to me in an online quiz.This is a very interesting question from Dynamic SQL in section Developing with SQL Server of SQL Server

Answer»

Correct option is (a) Stored PROCEDURE can not cache the execution plan for this DYNAMIC QUERY

To explain I would say: Stored procedure can not cache the execution plan for this dynamic query. So, for COMPLEX queries you will lose the performance boost that you USUALLY gain with stored procedures.



Discussion

No Comment Found

Related InterviewSolutions