an error when i want to conect to sql

hamidreza ganji 1 Reputation point
2022-07-14T06:38:04.2+00:00

Hello
I installed the 2019 version of SQL Server and then I installed the version 18.12.1of SQL Management studio. I installed all the SQL services and set them to run, but when I try to connect to the server in ssms, it gives me this error:
TITLE: Microsoft SQL Server Management Studio ------------------------------ Error connecting to '(local)'. ------------------------------ ADDITIONAL INFORMATION: Failed to retrieve data for this request. (Microsoft.SqlServer.Management.Sdk.Sfc) For help, click: https://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&LinkId=20476 ------------------------------ An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo) ------------------------------ A severe error occurred on the current command. The results, if any, should be discarded. (Microsoft SQL Server, Error: 0) For help, click: https://learn.microsoft.com/sql/relational-databases/errors-events/mssqlserver-0-database-engine-error ------------------------------ BUTTONS: OK ------------------------------

are there any one that solve this problem?

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

4 answers

Sort by: Most helpful
  1. CathyJi-MSFT 21,136 Reputation points Microsoft Vendor
    2022-07-15T02:47:22.727+00:00

    Hi @hamidreza ganji ,

    Did you choose the correct SQL server instance name in step 3? Please follow below steps from screenshot.
    220955-screenshot-2022-07-15-105212.jpg
    220981-screenshot-2022-07-15-105243.jpg

    If the issue still existed, please follow below steps to troubleshot this issue,

    1. Make sure SQL Server Service is running
    2. If a named instance, make sure SQL Server browser service is running. Make sure the instance name is spelled correct and there is actually such an instance on your target machine.
    3. Make sure SQL Server is configured to allow remote connections
    4. Examine the SQL Server error log for messages confirming that SQL is listening on the expected network interfaces and ports
    5. Test server connectivity with PING from the client machine
    6. Test port connectivity using TELNET to the server and port (from step 4) from the client machine. For example
      TELNET <server-name> 1433
    7. Check firewall settings if step 5 or 6 connectivity test fails

    If you have some confuse about the steps, please refer to Resolving could not open a connection to SQL Server errors or Troubleshoot connecting to the SQL Server Database Engine to get more information.

    If it is still not work, please share us the related error message from SQL server error log.


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

    2 people found this answer helpful.

  2. Olaf Helper 43,246 Reputation points
    2022-07-14T07:00:12.21+00:00

    Error connecting to '(local)'

    How did you get up with "(local)" as server name; that don't work? Use the machine name instead.

    0 comments No comments

  3. hamidreza ganji 1 Reputation point
    2022-07-14T07:12:46.907+00:00

    I test this but same result.

    0 comments No comments