Cannot connect to sql server from virtualized environment [closed] - sql

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I have a windows server 2012 R1 Enterprise that my colleague set up in a virtualized environment, the host PC is no not domain joined, but the virtual environment is.
The issue is for some reason that server is not able to connect to SQL servers within the domain network. I've enabled IP/firewall and I can connect to the SQL server from all the other non-virtual machines, so, I don't think it's to do anything with the SQL
It's just that hyper-v environment that I'm having issues with. I cannot even connect using the excel, it simply says "SQL Server does not exist or access denied." Anyone else experienced the same issue?
here is the error message I get trying to connect to one of SQL servers.
"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 corrrect and that SQL server is configured to allow remote connection. (Provider: Named Pipes Provider, Error: 40-Could not open a connection to SQL server) (Microsoft SQL Server, Error:5) --> Access is denied
thanks

Normally the order and types of protocols used to connect to sql server are configured when sql server is installed. the order and priority of which can be used to influence the default connection protocol when using SQL server management studio The error
(Provider: Named Pipes Provider, Error: 40-Could not open a connection to SQL server) (Microsoft SQL Server, Error:5) --> Access is denied"
Indicates that the protocol on the SQL server that the SQL server management studio is requested is either
Blocked by the firewall on the inbound or outbound machine
Or the protocol is not enabled
The connection protocol default can be overridden by selecting the connection properties tab and selecting another protocol choice other than default.
to see what default is configured for (on the server that sql studio is installed on" run the following query against the master database
SELECT net_transport
FROM sys.dm_exec_connections
WHERE session_id = ##SPID;

Related

Microsoft SQL Server 2014 too many services [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I have a problem. I can't start SQL Server 2014.
It's ok when I connect to a server as a Windows authentication, but when I try to connect as SQL Server authentication with username sa and my password, O get a SQL Server error 18456.
Why? When installing Management Studio with youtube video, there were few differences:
When installing new instance SQLExpress, there was error because the instance with this name already existed so I changed the name of instance to MSSQLServer...
Also in SQL Server Configuration Manager in SQL Server Services,there are 5 services and I think there shouldn't be so many:
Each SQL Server instance has their own services for different usages. Here you've 2 instances {"SQLEXPRESS", "MSSQLSERVER"}, each has its own SQL Agent. This is normal.
... but when I try to connect as SQL Server authentication with username sa and my password, O get a SQL Server error 18456. Why?
If you want to connect with system administrator account sa, you need to enable the mixed running mode of the target SQL Server instance, e.g. SQLEXPRESS. Because sa is not windows authentication. You've 2 options:
Enable this mixed running mode during the installation. Choose Windows Authentication and SQL Server Authentication.
Connect to your SQL Server instance with an adminstrator account using Windows Authentication and then change the server running mode.
If the server is already running on mixed mode, but you're still getting the same error. Then you're probably using a wrong password for sa. Did you use your windows password by mistake?

How to set up SQL server Agent? not showing in Sql Server Management [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I am trying to set up the SQL Server Agent on our test server running with windows Small Business Server 2011 Standard and SQL Server 2008 R2 RTM. The Sql Server Agent node is not displayed in Sql management studio.
Here is what I know according to forums I read:
in services.msc, I have two Sql Server Agent (Sharepoint and SBSMonitoring) set as automatic. If I try to start the service, the following warning comes up: The SQL Server Agent service on Local Computer started and then stopped. Some services stop automically if they are not in use by other services or programs
in SQL Server Configuration Manager, under SQL Server Services, I have an error "The remote procedure call failed [0x800706be]". Under SQL Server Network Configuration (32bit), nothing is listed.
in Local Security Policy, Security Settings -> Local Policies -> User Rights Assignement: their is no Sql Server Agent Listed
in Sql Server Management Studio I created a new user with all the rights possible and after I logged with this user, Sql Server Agent was not showing
I did the following command mofcomp c:\program files (x86) \Microsoft SQL Server\100\Shared\sqlmgmproviderxpsp2up.mof" but it did not change the error "The remote procedure call failed" in SQL Server Services
Does anyone have a solution according to these facts?
Thank you
select serverproperty('edition') returns Express edition.
As confirmed you are using an Express edition.
There is no way to get SQL Server Agent on this.

SQL Server Express - Connect from remote machine

I have two Win 7 64 bit machines.
On the first one I have installed SQL Server 2008 R2 Express and have no trouble connecting via Management Studio with Windows Auth and also via SQL Auth with a user I set up on the database.
On the second machine I am trying to connect to the database on machine 1 using Management Studio. I'm trying SQL Auth. I therefore obviously also can't connect to it via connection string in my .NET Code
I can ping the first machine from the second.
Things I have tried include the following:
On the machine the database is installed make sure the firewall is allowing connection on Port 1433
Made sure SQL Server service is running
Made sure SQL Server Browser service is running
Created an exception for sqlbrowser.exe in the firewall
Enabled TCP/IP Protocol through SQL Configuration manager
Allowed Remote connections in SQL Server Management Studio
The error I get is:
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
This is the connection string I use in code
Data Source=xxx.xxx.xxx.xxx\sqlexpress;Initial Catalog=dbName;User Id=myUser;Password=myPassword;
This can be caused by a number of reasons but I'm glad my suggestion about checking firewall ports (rather than just allowing a one-way exception for SQL Browser) led you to the answer: the firewall wasn't allowing the correct port # through.
If i remember correctly SQL Server disables remote connections by default.
Please check whether remote connections are enabled and enable them if not:
RMB on Server in Management Studio Object Explorer -> Properties -> Connections -> Allow remote connections...

Cannot connect remotely to SQL Server instance [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 9 years ago.
Improve this question
I have an instance of SQL Server 2012 and when I try to connect with it from other PC through SQL Server Management Studio it's not even visible. I can see all other instances which are placed on other PCs.
I tried everything to fix it:
disabled firewall
turned off Anti-Virus
enabled remote connections to this server
enabled TCP/IP protocol in SQL Server Manager
checked if SQL Server and SQL Server Browser is running
restarted SQL Server and SQL Server Browser a lot of times
also tried this: https://stackoverflow.com/a/11278115/2717303
and finally I have reinstalled SQL Server and every component of it
And still I can't see my instance. Does somebody have any other ideas how to fix it?
Here are some screenshots of SQL Server Configuration Manager:
What server name you are using ?
You have to open port for it. After opening port your server name looks like follow.
server name : IP\SqlExpress, 5012
Where 5012 is random port.

Connect To Proper Remote SQL server [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
On our development server we have three versions of SQL Server installed (SQLEXPRESS 08, SQL2008 R2, and SQL 2012).
In the services, I can see the following instances:
SQL Server (MSSQLSERVER)
SQL Server (SQLEXPRESS)
SQL Server (SQL2008)
When I open all three servers in SQL Mgmt Studio and connect to all three servers, I see the following names for the servers:
(local) (SQL Server 11.0.3128 - OBX1\Administrator)
(local)\SQLEXPRESS (SQL Server 10.50.2500 - OBX1\Administrator)
(local)\SQL2008 (SQL Server 10.50.2500 - OBX1\Administrator)
When I connect to the server at the IP address or server URL, it connects to the the SQLEXPRESS instance but I need to connect the 2012 instance, which is the at (local) (SQL Server 11.0.3128 - OBX1\Administrator).
No matter what I try, I can't get connected to any instance besides the default one, which for some reason seems to be SQLEXPRESS.
Looking for an example of the proper connection value for the other instances??
Screenshot below:
If I RDP to the server and open up SQL Mgmt Studio I have three options for servers to connect to, (local), (local)\SQL2008, (local)\SQLEXPRESS. If I select (local) and run the command to get servername and version I get OBX1 for the name and 2012 for the version. If I select (local)\SQL2008 and run the same commands I get OBX1\SQL2008 and SQL Server 2008 R2(sp1) and if I select (local)\SQLEXPRESS and run the command I get OBX1\SQLEXPRESS and SQL Server 2008 R2 (SP1).
Given this addition info, how do I connect the instance that is just (local) remotely with the IP Address? Is this possible?
Again, currently if I connect remotely at the_ip_address it connects to the SQLEXPRESS instance. And if I try to connect to, for example the SQLEXPRESS instance like so, the_ip_address\SQLEXPRESS it connects to the SQLEXPRESS instance again.
Duplciate of this: https://serverfault.com/questions/104922/sql-server-connection-string-question
To connect to a named SQL Server instance, you can:
Specify the server (machine) name and instance name in the connect string:
Server=myServerName\myInstanceName;Database=myDataBase;Trusted_Connection=True;
specify the specific port and either the server (machine) name or IP address:
Server=myServerName,1437;Database=myDataBase;Trusted_Connection=True;
Server=123.98.76.45,1437;Database=myDataBase;Trusted_Connection=True;
Note: Specifying port 1433 will [usually] get you the default, unnamed SQL Server instance on the machine (but not always as it depends on how SQL Server has been installed and configured). Note also that specifying an explicit port and and instance name makes no sense whatsoever.
And when in doubt, visit http://www.connectionstrings.com/ for pretty much any database out there [though connecting/configuring Oracle connections is its own peculiar form of hell].
You might need to identify and subsequently specify the portnumber as well. Ie:
tcp:MyServer,7701
tcp:MyServer,7704
Note that the portnumbers above are from one of my installations - yours may very well be different.
To identify the portnumbers, go to the SQL Server Configuration Manager and look under SQL Server Network Configuration. You should see separate entries for your instances here, and the properties for each instance should include a TCP Port or Dynamic Port or similar.
This answer may be useful.
You should enable the SQL Browser service, but it is most likely running. Also ensure TCP protocol is enabled for each service using SQL Server Configuration Manager application found in the SQL Server program group. You will find these settings under SQL Server Network Configuration. Some versions of SQL have TCP/IP disabled by default.
I'm not sure if the 2012 SQL Server configuration will see the other instances, so you may have to make the change in multiple places. I'd start in the 2012 Config Manager.
Specifying a port number when an instance is set up to use dynamic ports is probably not a good idea.
Some applications require you to set a static port - typical with JDBC apps.
If you're still having issues, check into firewalls. Portqry and telnet can help test connectivity.