How can you stop stored procedures from recompiling?



How can you stop stored procedures from recompiling?..

Answer / Jitender Kumar

"You can prevent stored procedures from recompiling by using OPTION (RECOMPILE) or OPTION (OPTIMIZE FOR UNKNOWN) in the procedure definition. OPTION (RECOMPILE) forces the procedure to be recompiled each time it is executed, while OPTION (OPTIMIZE FOR UNKNOWN) optimizes the query based on unknown values at execution time.nAnother way to prevent recompilation is by using a stored procedure cache, which caches compiled versions of stored procedures for reuse.n

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL Server Interview Questions

What are the disadvantages of merge replication?

1 Answers  


What happens if you insert a duplicate key for the primary key column in ms sql server?

1 Answers  


Explain the microsoft sql server delete command?

1 Answers  


what are questions asked in TCS for database tester (sqlserver)for 2-3 exp?

1 Answers   ABC, TCS,


what is difference between view and Dip.

1 Answers   IBM, L&T,


How to edit table in sql server 2017?

1 Answers  


What do we need queues in sql service broker?

1 Answers  


please differentiate between delete and truncate?

1 Answers  


What is the difference between lock, block and deadlock? : sql server database administration

1 Answers  


What is BCNF? How is it better than 2NF & 3NF?

1 Answers   Essar,


What are cursors in ms sql server?

1 Answers  


How to join two tables in a single query in ms sql server?

1 Answers  


Categories