I want to ask a question:
Can Dynamic SQL statement get the benefit of Table Index?
IvanIvan,
Yes. The SQL Server query processor must still parse the command that is
generated dynamically, and build a query plan for it. If the optimizer
determines that an index will help reduce the cost of the query, then the
optimizer may put the index access into the query plan, and the query engine
will use the index when executing the dynamic SQL query.
Ron
--
Ron Talmage
SQL Server MVP
"Ivan Kan" <ivankan@.no-ip.com> wrote in message
news:e0HAWtujDHA.3256@.tk2msftngp13.phx.gbl...
> I want to ask a question:
> Can Dynamic SQL statement get the benefit of Table Index?
> Ivan
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment