0

SQL Server Management Studio: network-related or instance-specific error while establishing a connection to SQL server.

Here's a screenshot of the error:

enter image description here

1
  • Thanks Stephen, Yes it did work on Thursday. I attached two database files and then closed Microsoft SQL Server Management Studio. Later, there was a windows update which was cancelled halfway. When revisiting MS SQL Server Management Studio on Friday, this error showed up.
    – 0nwards
    Commented Apr 9, 2011 at 20:30

2 Answers 2

2

Your screenshot shows you trying to connect to localhost from SQL Server Management Studio. This means you are implicitly making the following assumptions:

  • A SQL Server is already installed on localhost.

  • The SQL Server instance is currently running (check this in SQL Server Configuration Manager under "SQL Server Services").

  • The SQL Server instance is the default instance, and so is accessible without specifying an instance name such as localhost\SQLEXPRESS (open a command prompt and type sqlcmd -L to list your instances).

  • The SQL Server instance accepts connections via named pipes or TCP port 1433 (check this in SQL Server Configuration Manager under "SQL Server Network Configuration").

Which one of these assumptions is not true? Fix that and you'll probably be able to connect.

3
  • Yes, I'm trying to connect to server on localhost. It worked before, but now I'm seeing nothing under SQL Server Services. sqlcmd -L returns an empty list of servers.
    – 0nwards
    Commented Apr 9, 2011 at 20:35
  • If the SQL Server service itself (as opposed to the browser service and a few others) is not listed under SQL Server Services, then somehow your instance got uninstalled. You'll need to reinstall it. Commented Apr 11, 2011 at 15:26
  • Note that with SQL Server Express the instance name has to be included. This is different from the full SQL Server editions where with just the machine name it will then connect to the default database. So localhost\SQLEXPRESS and not just localhost.
    – Brian
    Commented Sep 24, 2013 at 2:32
0

I solved this issue by running the following command in an elevated command prompt as specified in this post.

net start mssqlserver

How to fix? Method 1

Go to the Services Console (Hit Win +R and type services.msc) and look for SQL Server (MSSQLSERVER. If it is not started, start the service.

Method 2

You can also start the service by running net start mssqlserver in an elevated command prompt.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .