A new feature in SQL Server Management Studio 2008 is 'outlining' (the ability to collapse regions). It is awesome. However, by default all regions are expanded. I can't seem to find a way to 'collapse all' (also called 'toggle outline' in Visual Studio). Is anyone aware of a way to do this? I've been tasked with reviewing a 3,000 line stored procedure, and collapsing regions one-by-one is cumbersome.
Unfortunately, while your suggestion works in Visual Studio, it does not work in SQL Server Management Studio 2008.
Shawn
2009-12-06 14:52:48
+1
A:
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.
Shawn
2009-12-06 18:48:39
A:
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.
Willem Jac
2010-08-18 08:25:33
Thanks for the creative answer. However, doing this only creates a single collapsed 'root' section. I was looking for a way to collapse all sections down so it was easier to read.
Shawn
2010-08-19 20:45:49