Install two SQL Server database instances on a computer at the same time. The default installation for the first time is the machine name, and the port number is 1433.
1. If you do not know the server name but want to log in, you can directly enter 127.0.0.1 and then enter: Select @ servername in the new query.
You can query the current server name or server name and Instance name. You can use this name to log on directly.
2. If you want to know the port number based on the Instance name, or you do not want to use the default port number, you need to modify the port number at this time.
You can go to 'configuration tool' --> 'SQL Server Configuration manager' --->' SQL Server network configuration' ---> 'instance name .. shows the Protocol '--> 'tcp/ip attribute:
Note the modification of the TCP port. Dynamic port does not need to be enabled. If it is enabled, or enter any number, the following port will be invalid.
After the modification is complete, you can use the server name + port number to log on.
Note: This figure shows SQL Server 2008.
If you feel not detailed enough, you can refer to this connection: http://www.cnblogs.com/xwdreamer/archive/2012/06/23/2559344.html