Cannot connect to SQL Server via TCP/IP - sql-server

I can't access my SQL Server on my PC from my laptop.
I already:
tried to turn off the firewall. I can ping my PC with my laptop.
enabled the TCP/IP protocol in network configuration in the SQL Server properties.
verified that the SQL Server service is running. I can access locally with toad.
Here is the environment :
OS - Windows XP
DBMS - SQL Server 2000
Thank you,
Regards

If you are in same network you should be able to access it via IP address. Can you please let us know a bit more.

Related

Unable to link SQL Server Express to SQL Server

I have a SQL Server version 12.0 instance installed on a Windows Server 2012R2 (SERVER/SQL), and a SQL Server Express version 11.0 instance installed on a windows 10 workstation (WIN10/SQLEXPRESS). Both are on the same domain. I am logged in as the domain admin and have full rights on both SQL instances.
On my WIN10 machine I am able to create a linked server from (WIN10/SQLEXPRESS) to (SERVER/SQL).
On my SERVER when I attempt to create a linked server from (SERVER/SQL) to (WIN10/SQLEXPRESS) I am told to ensure that the instance will allow for remote connections. I have gone through about 40 hours of troubleshooting this, ensuring that all firewalls, ports, security and agents and browsers are open.
Is there any reason I cannot link a SQL Server Express to another SQL Server, but can the other way around?
I would like to be able to call stored procedures from my main SQL Server but am not able to.
Please note, the purpose for the SQLEXPRESS on the WIN10 machine is due to the vendor requirements for the software I am using. Otherwise I would have the instance on my SERVER.
Almost certianly a network issue.
Using SQL Server Configuration Manager configure SQLEXPRESS to enable TCP/IP and listen on a fixed port, preferably 1433 if no other instance is on the server. Restart the instance.
Create a Windows Firewall rule enable inbound TCP/IP connections to the port.
Test network connectivity to the target port from the other server with powershell, eg:
PS C:\> test-netconnection WIN10 -Port 1433
Test SQL connectivity with SQLCMD or SSMS on the server to the WIN10 box.
Create the linked server.

Can't access SQL Server remotely that resides on an Azure Windows Server 2019 Virtual Machine

I have SQL Server Express installed on an Azure Windows Virtual Machine.
Steps I have taken:
updated the default port for SQL server in SQL Server Configuration Manager.
verified sql server is listening on that port (netstat -ano)
Added a Windows firewall rule to accept inbound traffic on that port (Scope of the rule limits to my static IP address)
added an inbound rule in Azure to allow access to that default port (Source IP address same as IP in Windows Firewall)
Verified Remote Connections are enabled in SSMS
Mixed authentication is enabled.
Verified user created is able to access the desired databases by logging in locally with Sql Server Management Studio. This is a sql server user and not a computer account
I am able to telnet and nc to the port.
The name of the SQL Server looks like this when i access it locally on the VM
localhost\SERVER_NAME or
hostname\SERVER_NAME
From a remote machine I am attempting to access this database using SSMS.
I have tried:
mydomain.com\SERVER_NAME -mydomain.com does resolve to the correct IP address
mydomain:1234\SERVER_NAME -1234 represents the default port that was set
I have verified the user name and password are correct. I have also tried turning off the Windows firewall which leads me to believe it might be the inbound rule in Azure but there's really nothing special to that rule, just allows traffic to the sql server port (1234, in this example).
What am i missing?
Can you please have a look to this article, if you did not yet, and ensure that you did all the steps required? To highlight a few important steps, please ensure:
Set the connectivity to publish
Use SQL Server Configuration Manager to manually enable the TCP/IP protocol
Use the SSMS to connect to your DB and use the following server address for your VM
Hope that it helps.
The correct connection string in SSMS is
mydomain,1234\SERVER_NAME
comma before port not colon.

Connecting to SQL Database Server Remotely

I'll preface my question with: I am an absolute beginner with respects to the nature of MS SQL Server and have a layman's understanding of networking and 'computers' in general...
So, I'm trying to replicate an environment where:
There is an 'application server' which hosts HPE's ALM
This communicates with a database server with a Microsoft SQL Server DB
I currently have Microsoft SQL 2012 Server with a sample DB uploaded onto it on one laptop (Laptop 1) and the ALM software on the other laptop (Laptop 2). Both are connected to the same WiFi network.
Laptop 2 is asking me for Database parameters such as:
DB Host Name
DB Port Number (1433 by default)
OR Connection String
I have little idea of what I'm doing - I'd have thought it might be possible to connect to the DB through some sort of variant of the IP address of Laptop 1... but I'm unsure.
How can I connect to a MS SQL 2012 DB from one laptop to another? I realise this is probably a loaded question - I'd be happy if someone can point me in the right direction rather than an exact answer!
Thanks guys,
ST
I see two potential issues:
A corporate laptop might have firewall restrictions. So, you have to
open port 1433 for SQL Server.
Possibly you are playing with SQL Express, which by default, does not
have TCP/IP connection enabled. To enable it run "SQL Server
configuration manager", go to Network
configuration->Protocols->TCP/IP->Enable->restart SQL Server. Also check other properties. If static port 1433 is not set - set it.
Two types of adjustments must be set before connecting to the remote SQL Server. These settings are necessary because without them the connection to the remote SQL Server will not be able to be successfully created
Configuration settings:
-The SQL Server instance to allow the protocol being requested
-Allow access through the Window Firewall
1- Enabling TCP/IP protocol
2- Configuring Windows Firewall
For More details see the link :
https://www.sqlshack.com/how-to-connect-to-a-remote-sql-server/

SQL Server database not publicly accessible through port 1433

Alright, I know this sounds pretty basic, but it is eluding me. I have a local server with SQL server 2017 installed (Express Edition, because - Free). I can access the database when remoted into the server without issue. The problem is when I try to access the server using the public IP rather than the local hostname. My router has this server in the DMZ currently and port forwarding is setup for port 1433. The server firewall is currently even turned off and I still cannot see it.
The SQL server does have TCP/IP enabled, it is listening on port 1433.
If you need any further information, let me know. I've been troubleshooting this for two hours and just lost at this point. I am no where near new to technology and servers, but not too familiar with SQL Server.
Make sure you have enabled remote connections.
http://web.synametrics.com/sqlexpressremote.htm

How to make SQL Server running in Virtual PC accessible to host OS?

I'm running SQL Server 2008 Express on Windows XP on a VirtualPC instance inside a Windows XP host. I want to be able to connect to databases on the guest instance using SSMS on the host. When I go to connect from SSMS on the host, and browse for servers, I see the instance of SQL Server on the guest. Yet when I try to connect, using a SQL authentication login, I get the following connection error:
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: 28 - Server doesn't support requested protocol) (Microsoft SQL Server, Error: -1)
I have:
* tried connecting with both Name Pipes and TCP/IP
* ensured that the SQL Browser service is up
* ensured that the firewall on the guest is open
* the server is configured to allow remote connections (according to the database engine properties within SSMS on the guest)
What am I missing?
EDIT: I figured this out. My resolution is below.
SELF-ACCEPTED ANSWER
Thanks for the ideas. After much fiddling I got things working. It turned out that I had not gone into the Sql Server Configuration Manager and enabled TCP/IP and Named Pipes as network protocols. So even though SSMS said remote connections were enabled, there was no protocol to allow for them other than shared memory. After I did this I restarted the SQL Server service, but things still didn't seem to work properly. Yet once I had rebooted both the guest and host, everything was working as expected.
How are your IP settings? Are you sharing the same IP address between the two machines? If so, then perhaps when your clients attempt to connect to 10.1.1.10, it is hitting the IP of the machine hosting the VPC instance, and that machine is not running the SQL Server instance. If possible, have VPC get its own IP and try that.
Mostly double check what you have already said,
turn off the guest firewall to make sure it isn't that.
Make sure your virtual machine networking is set to bridged and not NAT.
Try connecting to the IP address of the guest instead of its name.
Make sure the remote connections are allowed by SQL server and that both client and server are using tcp/ip (or named pipes if you prefer).
I don't know if enabling remote connections requires a restart of SQL server.
Try using SQL authentication to eliminate an authentication issue. Are you running on a domain?
To add some steps that are not explicitly called out above, what worked in my experience was to set up the Virtual PC's Networking to my physical network adapter.
Then disabled Windows Firewall for the Public Profile.
Hopefully could actually lock that down to port 1433.
Also, on the guest OS, if SQL Server is installed with only Windows Auth, you later add SQL auth, note that by default 'sa' is disabled for login access. Either 'enable' Login for 'sa' or (better idea) create Logins with appropriate permissions as needed.

Resources