Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8586429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:18:30+00:00 2026-06-11T22:18:30+00:00

Is there a way in SSMS editor to visually separate two comment blocks that

  • 0

Is there a way in SSMS editor to visually separate two comment blocks that are placed one right after another when the comments are collapsed?

Please look at the link below – remember that this code is just for demonstration purpose.

enter image description here

When this code is collapsed in the SSMS editor, I see all the commented code collapsed.

I want to be able to see each comment block as a separate collapsed region, as in below (this is an edited image) –

enter image description here

I did consider using a GO, but in my case this code is part of a stored procedure, and I have a BEGIN and END that encapsulates this part of code, so that will not work.

I thought of using BEGIN/END, but that will not work either because I only have comments and no code that goes inside.

The closest work-around I came up with is using a blank PRINT ” – but, I fee this is redundant, and even counter-productive when used inside a stored procedure that will always be called from the application and would never be run from SSMS except when debugging.

Does anyone have any ideas on this? Suggestions/direction of any free third-party plug-ins is also appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T22:18:31+00:00Added an answer on June 11, 2026 at 10:18 pm

    I don’t know of any way to do it without the comments collapsing into one region.

    In SQL Server 2008 Management Studio (and probably most recent ones), you can use {$REGION} to at least give you a way to name or describe the collapsed region, which may help:

    {$REGION "Comment One"}
    -- This is comment one
    {$ENDREGION}
    
    SELECT dbo.
    
    {$REGION "This is comment two"}
    -- This is a separate comment
    {$ENDREGION}
    
    SELECT ...
    

    SSMS image capture

    But there has to be content between the two regions, or they still get merged into one.

    The above also works while embedded inside /*..*/ comments, too (which is valid T-SQL, for @scriptfromscratch), but it still merges the comments unless there is content between them:

    /* {$REGION  "Test region 1"}
    -- This is a test comment
    {$ENDREGION}
    */
    
    SELECT dbo.something
    
    /* {$REGION "Test region 2"}
    This is test comment 2
    {$ENDREGION}
    */
    
    SELECT dbo.
    

    Embedded regions

    Embedded regions collapsed

    It looks to me like you’ll need a third-party tool of some sort that provides this functionality, but I’m not aware of one that does this, I’m afraid.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to create simple unit tests for SQL queries in SSMS?
Is there way that I can read the file from remote server using fopen
Is there any way in Notepad++ (or even with another tool) to change the
In SSMS and its immediate or locals window, is there a way to see
Is there any way to implement text editing macros in SSMS? I would, e.g.
Is there way to write some ConfigurationValidatorAttribute or in some other way that will
In SSMS is there a way to generate a script for table creation based
Is there way to get file from windows xp command prompt? I tried to
Is there way to automatically maximize the output window on hitting build and then
Is there way to copy a file into Plone with WebDAV and have Plone

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.