1
votes

I am trying to connect to my local sql server 2008 instance. I am using sql server management studio 2008 R2. logindetails:

servername: .\SQLEXPRESS
authentication: Windows Authentication
username:myuser

Interesting detail maybe: when I look in the sql server configurationmanager, under sql server services , there is nothing?

Error message:

TITLE: Connect to Server

Cannot connect to mymachinename\SQLEXPRESS.

ADDITIONAL INFORMATION:

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) (Microsoft SQL Server, Error: -1)

5
Open the "sql server configuration manager" and check whether an instance is running or not.kv-prajapati
in sql server services there is nothing:(user603007
maybe my predecessor did not install the database engine?user603007
Then you have to re-install SQL server.kv-prajapati
@user603007 before you re-install SQL Server, run SSCM as administrator (see my answer). My guess is that you need certain privileges to view the services and settings.user596075

5 Answers

2
votes

You may need to run SQL Server Configuration Manager as an administrator to see the services. Not sure why you see "nothing". What exactly do you mean by "nothing"?

Here's the checklist of things you need to look for:

  • SQL Server Express (in your case) is a named instance. Because of this you need to ensure that the SQL Server Browser service is started. You can do this through SQL Server Configuration Manager (SSCM). The reason this service needs to be started for named instances is that this is what is hit through port 1434 when a connection is trying to be made. Named instances use random ports (whereas the default instance is a set port, 1433 by default)
  • If you are trying to hit this instance remotedly, you need to go through SSCM and ensure that the enabled protocols in TCP/IP. By default, SQL Server Express enabled only Shared Memory protocol, as it is used often in local applications
  • Make sure you can ping the actual machine (if it is not the local box) to rule out network issues
2
votes

I had the same issue. I opened up my computer Managerment --> services screen and saw that SQl Server and SQL Server Agent were not running. I tried starting them and got a message that they could not be started due to a logon failure.

I opened them up(properties) changed the login id and password(mine had been updated recently) and then started the services. Opened up SQL and tried loggin in with windows authentication - worked like a charm. Basically, those services needed to be running.

Alternatively, I believe SQL configuration manager will point you to the same thing within the Services panel.

also try localhost vs local as the instance name if you are still unable to login.

Hope this helps!

0
votes

Ensure that your SQL Server instance is called SQLEXPRESS. You can have a quick look at the servers running in the Sql Server Configuration Manager. Usually you get this error when Management Studio can't find the Server instance.

Let us know how you get on!

0
votes

I ended up installing sql server again and now it works!

0
votes

May be you didn't have a SQL Server instance running from where you were trying to access SQL Server via SSMS