Q:

Get execution plans from query strings

I have an application with some sql queries in a class, each query inside stringBuilders..
I've made another application to extract the query from each string builder parsing the code.
The point is: I need to generate an execution plan for each one of this queries.
Is there any way to do this automatically without coping and pasting the query to the SQL Management Studio?

A:

A query execution plan largely depends on indexes within SQL Server.  This determines if scans or seeks will be required for a particular join or look up.  I'd say you can do part of an execution plan, but you'll never get everything just based on a query string.

