SQLServer mangement studio connection error

afonso vianna 20 Reputation points
2023-03-23T15:34:15.1533333+00:00

When I click to open a new query SSMS return an error like image bellow. If I click 'ok I am able to run any query. This error occur even when I right click on SQLQuery window and chose a new connection. All the SSMS configurations are defaulted

User's image

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,678 questions
0 comments No comments
{count} votes

Accepted answer
  1. Erland Sommarskog 100.9K Reputation points MVP
    2023-03-23T21:43:02.21+00:00

    That's sort of interesting - the error message suggests that there is a syntax error in the commands that SSMS emits when you start up a new query window.

    First of all, which version of SSMS do you have? The most recent version is 19.0.2. You may want to try that to see if the issue has been resolved.

    If it does, start Profiler to "spy" on SSMS to see what commands it submits when you open a new query window. Be sure to include the Starting events, since they will not complete if there is a syntax error.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. CosmogHong-MSFT 22,781 Reputation points Microsoft Vendor
    2023-03-24T06:50:37.21+00:00

    Hi @afonso vianna

    Try generate scripts using the in-built Generate Scripts task in SSMS and set the Script for Server Version on the Advanced Scripting Options dialog to the correct version of SQL Server you wish to target with the script.

    In SQL Server Management Studio, right click the DB -> Tasks -> Generate Scripts option.

    User's image

    Best regards,

    Cosmog Hong


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our Documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments