What is the difference between ad hoc and prepared query in sql server plan cache?
<p>I’m trying to understand the plan cache content of a sql server.</p>

<p>so my questions are:<br>
1. What is the difference between ad hoc and prepared plans?<br>
2.What should I know about it when trying to optimize the sql server plan cache?</p>