Is it possible to redirect (or create an alias) so that requests for a default instance of SQL redirect to a named instance?

Scenario is I have SQL 2008 R2 installed as a named instance MACHINENAME\SQL2008R2 and i have some scripts which i cannot update that are trying to connect to a Default instance of sql (either via Data Source=. or Data Source=MACHINENAME) and i would like them to run against the named instance instead of having to install a new Default instance. Is it possible?

  • Do you already have a Default Instance on this server? If not, would changing the port of MachineName\SQL2008R2 to 1433 be enough? – jscott Mar 12 '12 at 16:56
  • @jscott: AFAIK the port is always (by default) set to 1433 anyway so that won't make a difference. Also i just checked sql config and even my (non-running) sqlexpress instance uses 1433. – mundeep Mar 12 '12 at 17:30
  • This is super old, but port is not always set to 1433. If you have a default instance, it would have been 1433. The named instance would likely use a higher number port. If you shut down the default and set the named instance to 1433, hitting just the machine name should work. – Sam May 18 '17 at 22:17

You can use the SNAC on the client side to set up an Alias for that instance of SQL Server. This link, http://www.mssqltips.com/sqlservertip/1620/how-to-setup-and-use-a-sql-server-alias/, will describe how to set up the alias which can redirect your connection to where ever you set your alias to point to.

  • Note that this redirection happens on the client and not the server, so if you were using a separate application server you will have to do this on the application server and not the SQL server. If the entire application is installed on the SQL server then this should work with no problem. Also if the server is 64 bit you will probably want to create both an x86 and x64 alias since a lot of applications on 64 bit boxes (SSMS is an example) are still 32 bit. – Jason Cumberland Mar 12 '12 at 20:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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