So you get this error when you select New Query? Or is it only when you select Database-Attach?
Since you are accessing SQL 2022, it could be that SSMS 18 is not fully geared up for SQL 2022. Then again, I don't have any issues with SSMS 18 + SQL 2022 myself.
Unfortunately, it is not uncommon to see posts from people where SSMS is misbehaving grossly. SSMS is a fairly complex thing that builds on the Visual Studio Shell, so it is somewhat sensitive to disturbances in the environment.
Two things to try:
- Download and install the preview of SSMS 19. If you are lucky, SSMS 19 will work for you, and it has more support for SQL 2022.
- Azure Data Studio (ADS). This is the most recent SQL tool from Microsoft that also runs on Linux and Mac. ADS is bundled with the SSMS download, so you have it already. Just look in the Start menu. Personally, I'm less fond of ADS, and it does not have the same amount of GUI support as SSMS, but it is improving. And if all you want to do is to run queries, you should be able to get by with it.