Forum Discussion

MartinxN's avatar
MartinxN
Brass Contributor
Sep 15, 2021
Solved

Outlining not working in SSMS 18.x and 19.x

Edit, This problem is also present in SSMS 20.1, Does Microsoft care at all, or are they not capable of fixing this?

 

In SSMS 18.x and 19.x, the outlining feature that allows you to collapse SQL code often stops working, i.e. the +/- next to the code disappears and neither shortcuts or clicking in the menu will collapse code.

I have tried to uncheck outline statements in the option under intellisense and then recheck it, but that makes no difference.

Closing SSMS and restarting sometimes helps, but after a while I'm back to the same problem.

I have never had this issue in SSMS 17.x

 

Does anyone else have this problem, and how do you solve it?

 

  • MartinxN's avatar
    MartinxN
    May 15, 2023
    Sorry for not updating the original text, this issue is also present in SSMS 19, in fact everything newer than SSMS 17 has this problem

23 Replies

  • asocorro's avatar
    asocorro
    Copper Contributor

    MartinxN for me it wasn't working for two script files I had open, even after playing with all the suggested settings.  Then I closed and reopened the files and +/- toggles are there now.

      • chadbaldwin's avatar
        chadbaldwin
        Copper Contributor
        I'm just chiming in here to +1 this issue as a whole. This has been a major thorn in my side for nearly 3+ years so I'd LOVE to get this figured out. I am happy to help in any way possible and provide any information you need to get this issue tracked down.

        My suspicion is problems with RedGate SQL Prompt.

        For context...I'm working on a relatively clean PC, just recently installed SSMS 19.2 clean. I did not import any settings files. I also have the Red Gate SQL Essentials ToolBelt installed.

        I am happy to set up a completely fresh computer from scratch, install SSMS, install SQL Prompt, etc, whatever you need to see if this is fixable from your side.
  • Neilius's avatar
    Neilius
    Copper Contributor
    I am using version SSMS 20. This error has occurred for several versions.

    I think it occurs because of the size of the script. It stops working for me when my scripts reach a certain size (for me it's about 1Mb.

    The solution is t go into Tools / Options / Transact SQL / IntelliSense, tick both options, and IMPORTANT set "Maximum Script Size" to "Unlimited".

    If you do this, outlining will come back.
    • erinstellato's avatar
      erinstellato
      Icon for Microsoft rankMicrosoft

      Neilius Thank you for sharing your findings!  MartinxN, if you are able to test and confirm, that would be very helpful.  I can then update the documentation.  Thanks!

      • MartinxN's avatar
        MartinxN
        Brass Contributor
        Well, all I can confirm is that I have now set "Maximum Script Size" to "Unlimited" and the problem can still occur
  • Make sure the setting is enabled...go to Tools > Options > Text Editor > Transact-SQL > IntelliSense, ensure that Outline statements is enabled.
    • MartinxN's avatar
      MartinxN
      Brass Contributor

      erinstellato if you read my description carefully, you will notice this part:

      "I have tried to uncheck outline statements in the option under intellisense and then recheck it, but that makes no difference."

       

      the point being that I cannot enable it when it stops working, other than closing and restarting SSMS a couple of times until it starts working again, which is very annoying to have to do since it is very slow to close and to start

      • erinstellato's avatar
        erinstellato
        Icon for Microsoft rankMicrosoft
        Ah, my mistake, I misread it as the Intelliense option. I have this enabled for my local SSMS (version 19 and 20 installed) and have not seen the issue. Do you have any third party extensions installed? I noticed other folks mentioned RedGate Prompt but I am not sure if you have that extension, or any other one installed. Thanks.
  • JohnW128's avatar
    JohnW128
    Copper Contributor
    I'm having this problem as well, in version 18.10 (15.0.18390.0), with SQLPrompt installed. Reopening SSMS doesn't help. Occasionally, one level of outlining will appear at the start of a stored proc script. Once the outlining submenu disappeared from the Edit menu.

    I've tried altering most of the settings associated with outlining, but nothing has helped.

    This is a very useful feature, and I'd really like to be able to use it.
    • MartinxN's avatar
      MartinxN
      Brass Contributor
      When the problem appears even simple queries like this won't collapse:
      SELECT
      *
      FROM
      sys.objects
      • Hi MartinxN 

        This questions was originally asked on ‎15-09-2021 about 2 years ago. Are you saying that you work on the same issue for 2 years?!?

         

        You probably know what Dog Years means. In general each year for a dog is like 7 years for Human. This questions is more that one Computer years and each computer year is like 10000 years for Human as the tech change each minute. From the time you asked the question SSMS 18.x became obsolete. Therefore, the sirt step you should do, is to install the latest version of SSMS.

         

        Please upgrade to the latest version and confirm if the issue continue. If it was a known bug then it was probably fixed

         

        If the issue continue on the latest version of SSMS then w will dive into it more :smile:

Resources