SELECT ID, Name FROM Article WHERE Price > 100
SQL Server 2005 will replace constant literal values (100 in this example) by variables and this way query plan will be reuses for all queries similar to
SELECT ID, Name FROM Article WHERE Price > @p1
Not all of the ad-hock queries can be parameterized. If you are interested read this article.
No comments:
Post a Comment