This trick is useful if you need to “pretend” that a named instance is the default instance, e.g. to connect a poorly coded app that doesn’t support named instances.
In this case, I have a named instance called servername\NAMEDINSTANCE01.
It’s possible to change the port used by the instance in SQL Server Configuration Manager. Under SQL Server Network Configuration, navigate to Protocols for NAMEDINSTANCE01 & open the Properties for TCP/IP.
In the IP Addresses Tab, scroll to the bottom. For IPAll, clear the TCP Dynamic Ports value & set the TCP Port value to 1433 (the default port for SQL Server).
When you click Ok, a pop-up window will tell you that the change will not take effect until the service is restarted, so navigate to SQL Server Services & restart SQL Server (NAMEDINSTANCE01).
After the service has restarted, you can test the change by opening SSMS & connecting to the instance using only the server name, i.e. servername rather than servername\NAMEDINSTANCE01. By querying @@SERVERNAME, it’s possible to confirm that this is in fact the named instance, even though you are connecting to it as if it were the default instance & Object Explorer shows only the server name.
One caveat to be aware of is that you can’t have multiple instances listening on the same port so if you have a default instance installed on the server, you will be unable to set the named instance’s port to 1433 unless you change the default instance’s port. Likewise, you can’t have multiple named instances “pretending” to be the default instance by using this trick.
Be First to Comment