views:

223

answers:

3

I'd like to be able to convert SQL Server query plans from XML to images. Ideally a vector format, but a bitmap would do.

Is there an open source library to do this? Or can I use one of the SQL Server Management Studio DLLs?

Thanks.

A: 

MySQL workbench helps visualise a database. Not sure about MSSQL.

Nathan Friend
+1  A: 

I have seen people do some pretty funky stuff with XSLT. The most impressive was a modifying CAD style XML output from one app to another for importing.

You could use XSLT to create WPF markup, or PostScript... There are a few options there...

Paul Kohler
...of course - that said there is no reason you can't do this via code...
Paul Kohler
the problem is that how you can render the sqlplan xml like ssms does.
schrodinger's code
I'm marking this as the best answer as I'm pretty sure I'm going to have to do it myself. Having studied the schema further I agree that the algorithm could be represented as a functional transform on XML, but for my own sanity I will not use XSLT. ;) Thanks.
Ben Challenor
have you checked out that basic format, by using `set showplan_text on`, `go`, `some query` for example?
Paul Kohler
I have. It's more human-readable than the XML, but it's deprecated, and harder to parse than the XML. The XML schema is helpful here: http://schemas.microsoft.com/sqlserver/2004/07/showplan
Ben Challenor
Erk! When was it deprecated?
Paul Kohler
A: 

in SSMS 2008 you just right click on your execution plan and choose 'selected execution plan' and save picture to clipboard (or file)

SO you could open your xml queryplan in ssms and save it to picture file

Coentje
Right click only shows: "Save Execution Plan As..." and no matter what file extension you choose, it will be just an xml file.I do not know where your picture is coming from? Besides, the author is asking for a way to convert the sqlplan file to an image without using ssms.
schrodinger's code