0

Is there anyway I can connect to a SQL server that has no default instance, using just the server name? I've tried using SQL CMD, but it seems that the named instance name is required to login, regardless? Does anyone know how this could be acheived and what language?

closed as off-topic by Shawn Melton, Philᵀᴹ, RolandoMySQLDBA, RLF, mustaccio Nov 9 '15 at 17:28

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Too localized - this could be because your code has a typo, basic error, or is not relevant to most of our audience. Consider revising your question so that it appeals to a broader audience. As it stands, the question is unlikely to help other users (regarding typo questions, see this meta question for background)." – Shawn Melton, Philᵀᴹ, RolandoMySQLDBA, RLF, mustaccio
If this question can be reworded to fit the rules in the help center, please edit the question.

2

If there is no default instance, then you could force the named instance to listen on port 1433. SQL Server Configuration Manager, then navigate to the networking bit and turn off dynamic ports.

This article goes into details on how you can do that for multiple instances running on the same server, but it gets complicated fast. How to Add a Hostname alias for a SQL Server Instance.

So there are the methods, but why do you want to do it that way?

2

You can simply specify the server name and port number of the instance. To make this reliable, you need to ensure the instance has a static port specified in SQL Server Configuration Manager instead of using a dynamic port.

Once you know the port number, you can connect by specifying the "server name" like:

servername,00000

or

tcp:servername,00000

Where 00000 is obviously the port number.

Not the answer you're looking for? Browse other questions tagged or ask your own question.