Quick Regions in SQL Server Management Studio (SSMS)

There are a few tools and add-ins that support the creation of “regions” in T-SQL code. SQL Server Management Studio (SSMS) supports one way to separate sections of long-ish T-SQL scripts natively, by using begin/end:

To demonstrate, start with a snippet of T-SQL that includes begin/end:

SSMSRegion0

If you click on the “-“ highlighted above, the code will collapse and appear as show here:

SSMSRegion1

If you add a comment…

SSMSRegion2

Collapsing displays your comment, creating a quick “region” in your T-SQL:

SSMSRegion3

:{>

Andy Leonard

andyleonard.blog

Christian, husband, dad, grandpa, Data Philosopher, Data Engineer, Azure Data Factory, SSIS guy, and farmer. I was cloud before cloud was cool. :{>

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.