• chandan_jha18 (3/22/2013)


    Grant,

    As a side note, can you please let me know how to find the tables actually involved in the execution plan so that I can filter the unused ones. Do I need to go through the XML format of the plan and look each line or is there a better way?

    Regards

    Chandan Jha

    Well, you could walk through the XML... blech. Since it's a pretty simple execution plan with only 11 objects, you can just look at each one in the plan itself to identify where they're coming from.

    But, if you want to automate it, you can query the XML directly using XPath/Xquery language within T-SQL. I don't have an example for exactly this requirement, but I have a number of examples up on my blog.

    Or, you can also try using string manipulation like I do in this blog post[/url]. Again, not exactly what you're looking for, but it gives you the general idea.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning