Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Does anyone know of a way to convert legacy showplan text into a graphical format?

In other words, can I take the StmtText returned from SET SHOWPLAN_TEXT ON and convert that to show me a graphical execution plan? Would I need to parse it into XML, and the .sqlplan format in order to see the graph?

Eric:, here is the example, run against AdventureWorks:

SET SHOWPLAN_TEXT ON
GO

SELECT c.CustomerID, soh.ShipDate
FROM Sales.SalesOrderDetail sod
    INNER JOIN Sales.SalesOrderHeader soh ON sod.SalesOrderID = soh.SalesOrderID 
    INNER JOIN Sales.Customer c ON c.CustomerID = soh.CustomerID
WHERE sod.SpecialOfferID = 2
AND soh.ShipDate between '2003-01-01 00:00:00.000' and '2004-01-01 00:00:00.000'
AND c.CustomerType = 'I'

And you will see this StmtText returned:

StmtText
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  |--Hash Match(Inner Join, HASH:([soh].[CustomerID])=([c].[CustomerID]))
       |--Hash Match(Inner Join, HASH:([sod].[SalesOrderID])=([soh].[SalesOrderID]))
       |    |--Index Seek(OBJECT:([AdventureWorks].[Sales].[SalesOrderDetail].[ix_nc_SpecialOfferID_inc_SalesOrderID] AS [sod]), SEEK:([sod].[SpecialOfferID]=(2)) ORDERED FORWARD)
       |    |--Index Seek(OBJECT:([AdventureWorks].[Sales].[SalesOrderHeader].[ix_nc_ShipDate_inc_SalesOrderID_CustomerID] AS [soh]), SEEK:([soh].[ShipDate] >= '2003-01-01 00:00:00.000' AND [soh].[ShipDate] <= '2004-01-01 00:00:00.000') ORDERED FORWARD)
       |--Index Seek(OBJECT:([AdventureWorks].[Sales].[Customer].[ix_nc_CustomerType] AS [c]), SEEK:([c].[CustomerType]=N'I') ORDERED FORWARD)
share|improve this question
    
Have you tried to do this in SQL Sentry's Plan Explorer yet? –  Eric Humphrey - lotsahelp Mar 11 '11 at 22:05
    
Yes, I could not get it to work, but if you know of a way to use that tool to convert legacy text to a graphical plan, please share the steps involved. –  SQLRockstar Mar 11 '11 at 22:27
    
Do you have a sample we can test with? –  Eric Humphrey - lotsahelp Mar 12 '11 at 18:08
    
Eric, I added a sample statement and showplan_text that gets returned. –  SQLRockstar Mar 13 '11 at 18:34

1 Answer 1

up vote 2 down vote accepted

I have been told by colleagues at Microsoft that this is not possible, as the legacy SHOWPLAN_TEXT does not have enough details to display in a graphical format.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.