"collapse all' or "toggle outline" in SQL Server Management Studio 2008

In ssms 2017 -> There is an option in Tools > Options {see image}

The below illustrates @Triynko update to @Shawns answer

enter image description here


It appears this feature does not exist. It has been recommended to Microsoft. I suggest voting it up; http://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=368542

As a work-around, I'm using Notepad++ to edit locally. Its region identification isn't as good, but it's better than nothing.


This isn't a shortcut key, but there is a menu option in the Query Editor to do this.

Open your query and then go to Edit > Outlining > Toggle All Outlining.

This will toggle (i.e. expand/collapse) all nodes in the query.


A workaround is to use BEGIN and END.

BEGIN -- comment on/explain the region/outlined section

/*

TSQL goes here

*/

END

You will then be able to collapse the BEGIN.