Unable to connect to instance - sql-server

I've installed Microsoft SQL Server 2000 Desktop Engine (MSDE 2000) Release A using the following switches/parameters in the setup.ini file:
[Options]
SAPWD="sa"
DISABLENETWORKPROTOCOLS=0
DATADIR="C:\Program Files (x86)\SQL Server 2000\"
TARGETDIR="C:\Program Files (x86)\SQL Server 2000\"
When I try to connect to the instance in Management Studio 17, I get the attached error.
I've been bouncing around Google and couldn't find a solution here, I cannot see why it's not working. I have an instance, it's started, so I should be able to connect to it!!
Note that I also have SQL Server 2008 R2 installed and can connect to that instance no problem.
I'm looking to replicate an issue I'm having at work but can't even get SQL Server 2000 to work!
Please do you know what might be the issue?

MSSQLSERVER is the instance id for the default, unnamed instance. To connect to it, you should use:
.
(local)
or your machine name, or IP address
but without any instance name - most definitely not with MSSQLSERVER

Related

Connect to Server in SMSS 2017 on Virtual Machine

Need some help understanding how to connect to Sql Management Server Studios 2017 from my Azure Virtual Machine.
I thought I just enter my Computer (VM-computer name) in server name, see picture below, but I get the error saying: The server was not found or is not accesible. Do I need to configure it to allow remote access? Am lost and have tried googling without result, any easy step-by-step guides?
pic of login
You can use your server name in "servername" or . and the connect. If still not connecting do check whether it is named instances running in SQL Server Configuration Manager. If it is running with named instance you need to provide "Servername\namedinstancename" in server name
I did not have any sql installed, only the SSMS..........rookie move.

TFS 2015 connection with SQL Server 2014

I am trying to connect my TFS-2015 residing on one machine to the SQL Server 2014 residing on another machine.
This is my SQL Server instance name:
This is the error I get on TFS:
Please guide me the fix here.
It could be a firewall setting on the sql server. Can you connect using SSMS from another machine in your network? Are you using the default port? If so is there a firewall rule allowing traffic on 1433?
If connection is not the problem then it looks like a user right issue. The account running TFS and if it is different the account installing TFS will need a proper login to SQL.
https://blogs.msdn.microsoft.com/bharry/2010/08/20/database-permissions-required-to-configure-tfs/
Look at your screenshot: You only gave it a SQL instance name (MSSQLSERVER). You have to provide a database server name as well. How is it going to know what server to connect to otherwise?

SQL Connection Error While Connecting to Local Instance Using SSMS

I am trying to connect local instance in my SSMS 2005. it is showing me this error.. while i can connect the my system instance remotely or using Code. Last time it was working 2 days ago. now how suddenly this can happen.
In the Sql Server Configuration Manager->SQL Server Network Configuration->Protocols for MSSQLSERVER (or the name of your instance) check if TCP/IP Protocol is Enabled. If not, set to...
SQL Server Configuration Manager
If the solution above isnĀ“t work. I suggest you uninstall and reinstall SQL Server native client on the local computer

Check client connection to SQL Server 2008 Express [duplicate]

I just installed SQL Server 2008 Express on my Vista SP1 machine. I previously had 2005 on here and used it just fine with the old SQL Server Management Studio Express. I was able to connect with no problems to my PC-NAME\SQLEXPRESS instance (no, PC-NAME is not my computer name ;-).
I uninstalled 2005 and SQL Server Management Studio Express. I then installed SQL Server 2008 Express on my machine and elected to have it install SQL Server Management Studio Basic.
Now, when I try to connect to PC-NAME\SQLEXPRESS (with Windows Authentication, like I always did), I get the following message:
Cannot connect to PC-NAME\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: 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
When I installed SQL Server 2008, I had it use SQLEXPRESS as the local instance name. As far as I can tell, through SQL Server Configuration Manager, SQL Server is configured to allow remote connections.
When I went to the help link it mentions, the help page suggests the following:
Make sure that the SQL Server Browser service is started on the server.
Use the SQL Server Surface Area Configuration tool to enable SQL Server to accept remote connections. For more information about the SQL Server Surface Area Configuration Tool, see Surface Area Configuration for Services and Connections.
Well, as far as I can tell, there is no SQL Server Browser service on my system (looked in MMC for one, couldn't find one).
And the SQL Server Surface Area Configuration tool doesn't exist in SQL Server 2008. So good job there with your help documentation, Microsoft ;-).
I'm at a loss for what to do right now. I had a lot of work I was hoping to get done today after upgrading to 2008 (the person I'm working with got it up and running with no problem and told me it would be easy - he's also far better with database stuff that I am). Does anyone have any idea what might be wrong? I'd really appreciate it. If I can't get this working in a few hours, I'm going back to SQL Server 2005 (if that will even work, gah...).
Edit: I have tried turning Windows Firewall off, and that did not help. Also, I noticed that I do not have a "Data" directory under my SQL Server 2008 install directory tree - could I have possibly set something up wrong when I installed it?
Please check the ServerName which you provided. It should match with the below shown Name in the UserName textbox, and that name should followed with \SQLEXPRESS:
Start your Local SQL Server Service
Start SQL Config Manager: Click Start -> Microsoft SQL Server 2008 R2 -> SQL Server
Configuration Manager
Start SQL Services: Set the SQL Server (SQLEXPRESS) and SQL Server Browser services to automatic
start mode. Right-click each service -> Properties -> Go into the Service Tab
This will ensure they start up again if you restart your computer. Please check to ensure the state is "Running" for both services.
Login and authenticate with your Local SQL Server
Now open up SQL Server Management Studio and click "Connect to Object
Explorer" and select Server Name:
[Your PC name]\SQLEXPRESS
Example: 8540P-KL\SQLEXPRESS or (localhost)\SQLEXPRESS
To find your PC name: Right click My Computer -> Properties ->
Computer Name tab
Alternative: Login using windows authentication: Using the user name [Your
Domain]/[Your User Name]
Setup User Account
Create a new Login acct: In SQL Mgmt Studio -> Expand your local Server -> Security -> Right
click on Logins -> New Login
Set Password settings on New User Account: Uncheck Enforce password policy, password expiration and user must
change pw(Since this is local) Default database -> Your Database
Grant roles to New User Account: User Mapping Page -> Map to your db and grant db_owner role Status
Page -> Grant Permission to connect and Enable Login
Setup Access Permissions/Settings for User
Enable all auth modes: Right click your Local Server -> Properties -> Security Tab -> Enable
SQL Server and Windows Authentication Mode
Enable TCP/IP: Open SQL Server Configuration Manager -> SQL Server Network
Configuration -> Protocols for SQLEXPRESS -> Enable TCP/IP
Restart SQL Server Service: You will have to restart the SQL Server(SQLEXPRESS) after enabling TCP/IP
Database Properties File for Spring Project
database.url=jdbc:jtds:sqlserver://[local PC Computer
name];instance=SQLEXPRESS;DatabaseName=[db name];
database.username=[Your user name] database.password=[Your password]
database.driverClassName=net.sourceforge.jtds.jdbc.Driver
If you want to view larger screen shots and better formatting of the answer with more details please view the blog article below:
Setting up a Local Instance of SQL Server 2008 Blog Post:
I used (LocalDB)\MSSQLLocalDB as the server name, I was then able to see all the local databases.
Haha, oh boy, I figured it out. Somehow, someway, I did not install the Database Engine when I installed SQL Server 2008. I have no idea how I missed that, but that's what happened.
I know this question is old, but in case it helps anyone make sure the SQL Server Browser is running in the Services MSC. I installed SQL Server Express 2008 R2 and the SQL Server Browser Service was set to Disabled.
Start->Run->Services.msc
Find "SQL Server Browser"->Right Click->Properties
Set Startup Type to Automatic->Click Apply
Retry your connection.
I've just solved a problem related to this which may help other people.
Initially when loading up MSSMSE it had the server as PC_NAME\SQLEXPRESS and when I tried to connect it gave me Error: 26 - Error Locating Server/Instance Specified, so I went into SQL Server Configuration Manager to check if my SQL Server Browser and SQL Server services were running and set to automatic, only to find that instead of saying SQL Server (SQLEXPRESS) it says SQL Server(MSSQLSERVER).
I then tried connecting to PC-NAME\MSSQLSERVER and this time got SQL Network Interfaces, error: 25 - Connection string is not valid) (MicrosoftSQL Server, Error: 87) The parameter is incorrect so I googled this error and found that somebody had suggested that instead of using PC-NAME\MSSQLSERVER just use PC-NAME as the Server Name at the server connection interface, and this seems to work.
There's a link here http://learningsqlserver.wordpress.com/2011/01/21/what-version-of-sql-server-do-i-have/ which explains that MSSQLSERVER is the default instance and can be connected to by using just your hostname.
I think this may have arisen because I've had SQL Server 2008 installed at some point in the past.
Under Configuration Manager and Network Configuration and Protocols for your instance is TCP/IP Enabled? That could be the problem.
var.connectionstring = "server=localhost; database=dbname; integrated security=yes"
or
var.connectionstring = "server=localhost; database=dbname; login=yourlogin; pwd=yourpass"
For me, I was only able to get it to work by using "." in the server name field; was banging away for awhile trying different combos of the user name and server name. Note that during install of the server (ie this file: SQLEXPR_x64_ENU.exe) i checked default instance which defaults the name to MSSQLSERVER; the above high voted answers might be best used for separate named (ie when you need more than 1) server instances.
both of these videos helped me out:
use dot for server name: https://www.youtube.com/watch?v=DLrxFXXeLFk
general setup: https://www.youtube.com/watch?v=vng0P8Gfx2g
One of the first things that you should check is that the SQL Server (MSSQLSERVER) is started. You can go to the Services Console (services.msc) and look for SQL Server (MSSQLSERVER) to see that it is started. If not, then start the service.
You could also do this through an elevated command prompt by typing net start mssqlserver.
For me it was a windows firewall issue. Allow incoming connections. Opening port didn't work but allow programs did.
Link
Link2

SQL Server 2008 R2 can't connect to local database in Management Studio

I am using SQL Server 2008 R2 Express.
I first installed SQL Server 2008 R2 Express Management Studio and then I installed SQL Server 2008 R2 Express. I have the instance SQLEXPRESS running and it is set to automatic.
I am trying to connect to it locally using Windows authentication - server name is set to local and the username is grayed out and set to my profile username.
When I try to connect I get the following error:
Have I installed the wrong SQL Server Management Studio?
If your instance is called SQLEXPRESS, then you need to use .\SQLEXPRESS or (local)\SQLEXPRESS or yourMachineName\SQLEXPRESS as your server name - if you have a named instance, you need to specify that name of the instance in your server name.
Your "SQL Server Browser" service has to be started too.
Browse to Computer Management > Services.
Find find "SQL Server Browser"
set it to Automatic
and also Manually start it (2)
Hope it helps.
Follow these steps to connect with SQL Server 2008 r2 (windows authentication)
Step 1: Goto Control Panel --> Administrator Tools --> Services
select SQL SERVER (MSSQLSERVER) and double click on it
Step 2:
Click on start Service
Step 3:
Now login to SQL server with Windows authentication
and use user name : (local)
Enjoy ...
I also received this error when the service stopped. Here's another path to start your service...
Search for "Services" in you start menu like so and click on it:
Find the service for the instance you need started and select it
(shown below)
Click start (shown below)
Note: As Kenan stated, if your services Startup Type is not set to Automatic, then you probably want to double click on the service and set it to Automatic.
I know, this problem can be faced by so many people and many of them have uninstalled and re-installed the sql server for resolving this issue.
In my observation the problem of not connecting the database service locally is just because of your network connection you are using, in most of the cases these problems will come when you are using wi-fi network.
Solution is, if you are using wi-fi then just right click on status of the network and get the ip details and enter the same ip in sql server name,
it will work.
Regards
Vishwajeet
I have the same error but with different case. Let me quote the solution from here:
Luckly I also have the same set up on my desktop. I have installed
first default instance and then Sql Express. Everything is fine for
me for several days. Then I tried connecting the way you trying, i.e
with MachineName\MsSqlServer to default instance and I got exctaly the
same error.
So the solution is when you trying to connect to default instance you
don't need to provide instance name.(well this is something puzzled
me, why it is failing when we are giving instance name when it is a
default instance? Is it some bug, don't know)
Just try with - PC-NAME and everything will be fine. PC-NAME is the
MSSQLServer instance.
Edit : Well after reading your question again I realized that you are
not aware of the fact that MSSQLSERVER is the default instance of Sql
Server. And for connecting to default instance (MSSQLSERVER) you
don't need to provide the instance name in connection string. The
"MachineName" is itself means "MachineName\MSSQLSERVER".
Lots of the above helped for me, plus the accepted answer, but since I was on an EC2 instance, I had no idea what my instance name was. Finally, I opened SQLServer Configuration Manager and in the Name column, use whatever is there as your connection server, so in my case, .\EC2SQLEXPRESS and worked great!
Okay so there might be various reasons behind Sql Server Management Studio's(SSMS) above behaviour:
1.It seems that if our SSMS hasn't been opened for quite some while, the OS puts it to sleep.The solution is to manually activate our SQL server as shown below:
Go to Computer Management-->Services and Applications-->Services. As you see that the status of this service is currently blank which means that it has stopped.
Double click the SQL Server option and a wizard box will popup as shown below.Set the startup type to "Automatic" and click on the start button which will start our SQL service.
Now check the status of your SQL Server. It will display as "Running".
Also you need to check that other associated services which are also required by our SQL Server to fully function are also up and running such as SQL Server Browser,SQL Server Agent,etc.
2.The second reason could be due to incorrect credentials entered.So enter in the correct credentials.
3.If you happen to forget your credentials then follow the below steps:
First what you could do is sign in using "Windows Authentication" instead of "SQL Server Authentication".This will work only if you are logged in as administrator.
Second case what if you forget your local server name? No issues simply use "." instead of your server name and it should work.
NOTE: This will only work for local server and not for remote server.To connect to a remote server you need to have an I.P. address of your remote server.
I had this problem. My solution is: change same password of other in windowns. Restart Service (check logon in tab Service SQL).

Resources