Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to control which SQL Server instance localhost points to

I have 2 instances of SQL Server on my PC, one is SQL Server 2008 R2, the other SQL Server 2012.

If I use LOCALHOST when connecting to SQL Server, it goes to the SQL Server 2008 R2 instance.

I want it to point to the SQL Server 2012 instance.

Does anyone know how I can achieve this?

like image 536
Mr McGoo Avatar asked Oct 31 '12 20:10

Mr McGoo


People also ask

How do I change the connection properties in SQL?

To view or change server properties In the details pane, right-click SQL Server (<instancename>), and then select Properties. In the SQL Server (<instancename>) Properties dialog box, change the server properties on the Service tab or the Advanced tab, and then select OK.


1 Answers

It is very easy using Aliases: 1. Go to SQL Server Configuration. 2. Click on Aliases and setup localhost => localhost\name of your instance 3. do the same thing under 64bit aliases as well

If you have more than once instance localhost might get confused, therefore go to protocols for you name instance and change IP address to 127.0.0.1 which is localhost

like image 194
user2020571 Avatar answered Oct 10 '22 18:10

user2020571