Search code examples
sql-servert-sqlformattingssmsformatter

How do I use Poor Man's T-SQL Formatter in SSMS v20?


On installing SQL Server Management Studio v20, the menu items for Poor Man's T-SQL Formatter are gone.

enter image description here

Things worked fine in v18 after following the advice here: https://stackoverflow.com/a/72996345/4830285 Not so in v20.

How do I use the tool in SQL Server Management Studio v20?


Solution

    1. Open regedit (Registry Editor)
    2. Find your way to HKEY_CURRENT_USER\SOFTWARE\Microsoft\SQL Server Management Studio
    3. If you have SSMS 19 installed you will find 19.0_IsoShell_Config, if you have SSMS 20 installed you will find 20.0_IsoShell_Config
    4. Rename it to 18.0_IsoShell_Config
    5. Run PoorMan's Setup.
    6. Change back the Registry folder back to 19.0_IsoShell_Config or 20.0_IsoShell_Config
    7. Find your SSMS installation folder and open the Common7/IDE folder (C:\Program Files (x86)\Microsoft SQL Server Management Studio 20\Common7\IDE) and open the ssms.exe.config file
    8. Under <assemblyBinding> Add :
    <dependentAssembly> 
        <assemblyIdentity name="Microsoft.VisualStudio.Shell.12.0" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
        <bindingRedirect oldVersion="2.0.0.0-15.0.0.0" newVersion="15.0.0.0"/> 
    </dependentAssembly>
    
    1. Open SSMS. You should find Poor Man's Formatter in the Tools