Can't connect to server on SQL Server Management Studio 2008 - sql-server-2008

When I open the Management Studio and try to connect using the [PCNAME]/SQLEXPRESS it shows this error:
"Cannot connect to [PCNAME]\SQLEXPRESS"
ADDITIONAL INFORMATION:
Error Message:
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)
For help, click:
http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=-1&LinkId=20476"
I've also tried "localhost", "local" and "." in the place for [PCNAME] but to no avail.

Make sure SQL Server (SQL Express) service is running.
in powershell prompt type:
Get-Service -Name 'MSSQL$SQLEXPRESS'
service "status" property should be reported as "Running"
If it is not, type (you need to be in elevated prompt, i.e. "Run as Administrator"):
Start-Service -Name 'MSSQL$SQLEXPRESS'
OR
click start > type cmd and type
sc query MSSQL$SQLEXPRESS
State should be reported as "Running"
If it is not, type (you need to be in elevated prompt, i.e. "Run as Administrator"):
sc start MSSQL$SQLEXPRESS
If you get an error that the service cannot be found:
Open SQL server Configuration Manager and make sure you have SQL server express installed:

open you sqlserver config manager enable your tcpip both sqlserver and express and also under client protocol anf try to turnoff your firewall this will allow remote connection

first check sql server is running or not if not start it from services.msc
then
add .\SQLEXPRESS it will resolve problem

Related

SQL Server Mgmt Studio 2014 ; Error 40

I just installed MS SQL SERVER MANAGEMENT STUDIO 2014 , but when I open it I have to add a server name to connect it but it is showing me following error when I enter server name.
TITLE: Connect to Server
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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 2) The system cannot find the file specified
I don't know what to do now, help me out please.
Thanks
Error
Here's mine, if it helps. See if you should have more to it, like SQLEXPRESSPC in my case.
You need to provide an instance name.
Instance Name has been provided during the installation process of SQL Server.
Inside the Server name combobox, you should type something like : .\SQLEXPRESS or .\MSSQLEXPRESS depending on your version of SQLServer.
The .\ refer to your local machine.

Connect to sql server with management studio

I have a sql server hosted on go daddy that I simply am unable to connect to using Visual Web Developer 2010 Express or Microsoft SQL Server Management Studio.
Cannot connect to RBSAssetTracker.db.2574383.hostedresource.com.
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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 67)
Am I missing something? This seems like it should be relatively simple to accomplish this.
first check whether you can ping the database server then check following
Step 1) Make sure SQL SERVER is up and the instance you try to connect is running.
Step 2) Your system Firewall should not block SQL Server port.
Step 3) Go to Computer Management >> Service and Application >> SQL Server 2005 Configuration >> Network Configuration
Enable TCP/IP protocol. Make sure that SQL SERVER port is by Default 1433.
Step 4) Now follow this KB Article of MSDN depending on your server : http://support.microsoft.com/default.aspx?scid=kb;EN-US;914277
open your godaddy account,
click launch under your webhosting menu,
click on SQL server database
click actions-->details and watch for the 'hostname'
it will be like : databasename.db.99999999.hostedresource.com
copy and paste that thing to 'Server name' while logging to your management studio
Enter your godaddy sql-server database username and password to login in management studio. It should work right.

Can't connect to local SQL Server

I'm trying to call a sproc from EntLib (MVC3, EntLib5, SQL Server 2008). I'm using the default instance of SQL Server and can connect to it just fine from SQL Server Management Studio. I've tried everything I could find online and nothing gets me connected. The service is running as LocalSystem. Here's the connecction string:
Server=local;Database=Test;Trusted_Connection=True
Here's the error message I'm getting:
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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
Server should be "localhost", not "local", and the "TCP/IP" and "Named Pipes" protocols should be enabled in SQL Server Configuration Manager. Also, if you want to use a trusted connection, you might need to enable Windows Authentication on your MVC3 application, otherwise provide a username and password in the connection string as well.
If you are working with your local SQL Server you need to use localhost or "."

Getting Error when accessing SSRS through browser

I get the error message below when accessing Reporting Services through a browser
URL used: http://<name of server>/ReportServer
Reporting Services Error
The report server cannot open a connection to the report server
database. A connection to the database is required for all requests
and processing. (rsReportServerDatabaseUnavailable) Get Online Help 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: Named
Pipes Provider, error: 40 - Could not open a connection to SQL Server)
Have you verified that the configuration is correct? Use "Reporting Service Configuration Manager" which is installed with SSRS. Step through the screens looking for problems; try applying the configuration and make sure databases exist and have correct permissions.
Try running RSConfigTool.exe or Report Services Configuration Manager from Windows and check if the server is accessible

SQL Server add host for connection string

My server name now is AVI-PC\SQLEXPRESS and it is working, I want to add an other host to the SQL Server.
I want to add sqllocalhost\SQLEXPRESS.
So I went to etc/host and added the following line:
127.0.0.1 sqllocalhost
but I could not connect.
So I ping to AVI-PC and I got the following address: fe80::bdc4:33a7:b403:d7f6%10.
So I tried to add
fe80::bdc4:33a7:b403:d7f6%10 sqllocalhost
and still not working.
(I have restart the server and the PC).
Edit
This is the config:
this is the exception:
===================================
Cannot connect to sqllocalhost.
===================================
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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (.Net SqlClient Data Provider)
You want to create an SQL Server alias. Right?
Let's say you have
SEXYMF-PC\SQLEXPRESS
And you want to connect to that server with a different name: dev\SQLEXPRESS
To do that you need to go to Start > All Programs > Microsoft SQL Server 2008 > Configuration Tools > SQL Server Configuration Manager
Once it opens you will see:
SQL Native Client 10.0 Configuration
Client Protocols
Aliases
Right-click on Aliases and click on New Alias. There you enter
Alias Name = dev\SQLEXPRESS
Port No =
Protocol = TCP/IP
Server = SEXYMF-PC\SQLEXPRESS
Click ok and thats it. You can now connect to your SEXYMF-PC\SQLEXPRESS using dev\SQLEXPRESS
EDIT:
Can you connect to "SEXYMF-PC\SQLEXPRESS" using SQL Server Management Studio? If yes, there try to connect to your alias name: dev\SQLEXPRESS. Does it work?
Concerning this message:
(provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
1. Check if you have your SQL SErver Browser service on
2. Check again SQL Server Configuration Manager under - SQL Native Client 10.0 Configuration > Client Protocols > Named Pipes - and set to Enabled (if it is disabled).