Accessing SQL Server 2008 R2 Express with SQL Server Management Studio - sql-server-2008

OK maybe I'm being stupid somehow, and my googleing has not found a clear step by step user case for beginners.
I have just installed into my Win 7 Pro 64-bit SP1 machine SQL Server 2008 R2 Express Database with Advanced Services [downloaded from here http://www.microsoft.com/express/Database/InstallOptions.aspx]. (Actually I have removed and installed it 3 times now to check I'm not missing anything config wise). I have left basically all settings as default, with the exception of calling the Instance SQLEXPRESS (all caps vs default SQLexpress) my last installation I have left set as 'windows authentication mode' with only the same user as I am running now selected (only one user on this machine anyway).
After completion I have restarted the machine, I can see the services
SQL Server (SQLEXPRESS) -> Started -> Automatic
SQL Server Agent (SQLEXPRESS) -> -> Manual
SQL Server Browser -> -> Manual
SQL Server Reporting Service (SQLEXPRESS) -> Started -> Automatic
SQL Server VSS Writer -> Started -> Automatic
.. So it seems to be up OK.
As part of the installation process it also installed SQL Server Management Studio 2008 R2 and when I try and connect I am choosing:
Server: Database Engine
Servername : \SQLEXPRESS
Authentication: Windows Authentication
User name: (selected for me and not alterable) machinename\username
Password: (also blank greyed out)
I hit connect and get the following message.
Cannot connect to \SQLEXPRESS.
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: 25 - Connection
string is not valid) (.Net SqlClient
Data Provider)
Error Number: 87
Severity: 20
State: 0
OK, so given I am not entering a username or password, and I'm certain of the server instance name - and that it is running ... what am I doing wrong?

Here are a few troubleshooting tips for connecting to SQL Server via SSMS:
Ensure you're connecting to .\sqlexpress or localhost\sqlexpress, or (local)\sqlexpress. It's not case sensitive. It appears you're missing the hostname in the server name field in the connection dialog.
You're using Windows/AD authentication, so you don't have to enter any credentials. It appears you're all set there.

Related

“The server was not found or was not accessible” Error for SQL Server 2008

Error message is like this:
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: 51 - An instance name was not specified while connecting to a Local Database Runtime. Specify an instance name in the format (localdb)\instance_name.)
And my scenario: IIS and SQL Server 2008 are on the same test workstation, whose firewall is not enabled at all. I don't see any SQL Server log so I can't find any other useful information than the error message above.
I installed SQL Server as default instance (MSSQLSERVER)
My connection string is like this (I am using SQL Server account for authentication):
Server=(localdb); Database=MY_DB_NAME; User ID=MY_USER_ID; Password=MY_PASSWORD
I already verified this user has access to the target database (as owner)
I have gone through some articles on how to track down this problem: I set "allow remote connection" even though IIS and SQL Server are on the same machine. I don't need to set-up firewall.
If you have a standard, unnamed instance, you should use . or (local) (but not (localdb) !) as your server name
Try to use this connection string:
Server=(local); Database=MY_DB_NAME; User ID=MY_USER_ID; Password=MY_PASSWORD

Connection to SQL Server 2008: error 18452

I have a problem with connection to SQL Server 2008.
My problem is all simple user can't connect to SQL Server 2008 but just the admin in subdomain only who can connected.
I test the connection with these steps:
control panel / set up odbc
system DNS / I choose SQL Server
click on the bottom Add
in the Name=test, and the server = I choose SQLSERVER
When I clicked Next bottom I have error 18452.
Connection failed: SQLState: '28000'
SQL Server Error: 18452
[Microsoft][ODBC SQL Server Driver][SQL Server] connection failed.
SQL Server Error: 18452
Login failed for user ". The user is not associated with a trusted SQL
Server connection.
You should create new DSN with changed Authentication Mode from Windows Authentication Mode to SQL Server Authentication. Then specify login and pass for connection. This login should be added on SQL too.
I were trying to do the same, saw a lot of videos trying to accomplish the add of the DSN but this was my solution.
I'm running Windows Server 2016:
I ran the ODBC 64bit -> System DSN tab -> Add button
Then I selected SQL Server, since i had SQL Server Management Studio 17.
I putted a Name and the fact that is really important: Write the SQL Server you know you have connection to on the Server field.
Be sure you had configured the Security on Server authentication for SQL Server and Windows Authentication mode and then write the user you know that have access to that Data Base.
Last step: you click next after putting the info of the user that have acces to the SQL Server and the connection will pass.
Hope this help someone.

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 access SQL Server 2008 via windows service

I have an application which connects to SQL Server 2008 via windows service.Basically,windows service pics up a configuration file to get connection details like instance name , user name & password.Currently this windows service is failing to start with following 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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
Application server and DB server are different machines.I can connect to SQL Server via SSMS from application server without any issue. Also I created a UDL on app server and it also connected fine to DB server. Any help here is much appreciated.
Check the account under witch windows service is running- most possible that account is not allowed to make connections to other computers.

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).