Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Server instance name with IP address

I have a very strange situation happening and I'm hoping someone here knows why.

I have TCP/IP enabled for all ports on the default port 1433.

All tests are consistent with SQL Server Management Studio and my program.

This works:

  • ComputerName\InstanceName
  • 127.0.0.1
  • 127.0.0.1,1433
  • 192.168.1.100
  • 192.168.1.100,1433

This does NOT work:

  • 127.0.0.1\InstanceName

Note: I know it's not firewall related because I can telnet into 127.0.0.1 on port 1433.

Note2: The connection string doesn't matter since the tests are consistent with Management Studio, but I'll give it anyway: server={0};Integrated Security=True;Database=MyDatabase

While reading MSDN it seems that you should be able to connect to an instance name via an IP address.

What's going on here?

like image 506
Net Citizen Avatar asked Sep 12 '26 10:09

Net Citizen


1 Answers

Named SQL instances listen on a random port by default. You need SQL Browser service started, this listens UDP on 1434 and responds to instance discovery requests instructing the client the true listening port. You also need to allow the firewall to poke holes based on process name, so that SQL can bind at any port it feels like.

Otherwise you must explicitly force the named instance on the non-named port.

like image 144
Remus Rusanu Avatar answered Sep 14 '26 23:09

Remus Rusanu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!