how to know Graphical Execution Plans works through xmlcode in sql server?

  • i am trying to figureout this issue if anyone know please let me know the process of this..

    Issue with Graphical Execution plan how it works/internally

    If we run this below query it returns result in one column in xml code..

    If we click this link it opens graphical execution plan.

    SELECT

    [st].[objectid]

    , [st].[text]

    , [qp].[query_plan]

    FROM sys.dm_exec_cached_plans cp

    CROSS APPLY sys.dm_exec_sql_text ( cp.plan_handle ) st

    CROSS APPLY sys.dm_exec_query_plan ( cp.plan_handle ) qp ;

    May i know the process how it work it little bit urgent..

    advanced Thanks for your suggestions.I am waiting for your replies....

  • What specifically are you looking to know and why?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • http://www.sqlservercentral.com/articles/books/94937/

    The SQL Guy @ blogspot[/url]

    @SeanPearceSQL

    About Me[/url]

  • SELECT

    [qp].[query_plan]

    FROM sys.dm_exec_cached_plans cp

    CROSS APPLY sys.dm_exec_sql_text ( cp.plan_handle ) st

    CROSS APPLY sys.dm_exec_query_plan ( cp.plan_handle ) qp ;

    1) If we execute this query it returns result in xml code.

    2) If we click that xml code it opens executionplan.sqlplan tab in ssms it shows Graphical Execution plan.

    I am trying to findout how it works internally......:crying:

    Please let me know if anyone knows.

  • The XML name space in the XML is <ShowPlanXML xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan".....> so it knows that its a query plan and then opens it in the correct format

  • Satish Hottur (12/19/2012)


    I am trying to findout how it works internally......:crying:

    How what works? The graphical view of the XML file? That's just an SSMS feature, the management tool can interpret the XML plan and display it in a graphical format. Nothing to do with SQL Server itself.

    What are you trying to figure out here?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • The graphical plans aren't "internal". They're done in the presentation layer (usually Management Studio) from the XML.

    If you want to copy that functionality to a different application, you'll have to write code for it. It's not something SQL Server does, it's something applications do.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply