Tool to expand SQL Server views?

Published 21 April 6 3:35 AM | GregLow

In a previous post, I mentioned the sort of performance problems I see (when doing consulting work) that relate to the use of VIEWs. A discussion on this on our local mailing lists in the last day or so got me thinking that a tool is needed.

I'd like to see a tool that could be used from within SQL Server Management Studio where you could:

a) highlight some T-SQL text in a query window

b) right-click it and have it expand out the code, including all the underlying views, into another query window. (would obviously also need to be permission-based)

In a perfect world, there would then also be an option to simplify a section of T-SQL code in basic ways eg:

a) remove unnecessary underlying table joins

b) remove duplicated where clause entries

etc.

I've put a post on the feedback site. If you'd like to see it, please vote for it at: http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=cbd046de-073a-42af-8e3d-481ef66be0c6