Reputation: 11
I have two instances of Microsoft SQL on my PC. Original instance, default instance, is v2014, referenced as 12.0.42370.0 in the SMS screen shot image. For an upgrade to our application, I installed a second instance of SQL, v2019 as MSSQLSERVER01. It shows as 15.0.2000.5 in the SMS screen shot.
Our .net application uses the default instance, ie: . for the connection string. For testing the new application, I changed the connection string to MSSQLSERVER01. Now that our application has been released, I want to remove the older (default) version of SQL, and just keep V2019.
I also want to be able to reference the default connection as ".". How can I swap these 2 instance names, so v2014 can be removed and be able to reference v2019 as the default instance name of .?
I reviewed the suggested tips for renaming an instance. In this case, both instances are up and active though.
For the answer suggested below and my follow-up comments, I'm attached more screen shots:
In SMS the default connection . fails as expected as I've shut down the service and tcipip.
The second instance connection succeeds in SMS, still referenced by MSSQLSERVER01.
Upvotes: 0
Views: 844
Reputation: 89396
That should redirect most apps using the hostname, '.', or localhost
to the new instance.
Then connect to the instance in SSMS and look at the SQL Server Log you should see a message like Server is listening on ['any' <ipv4> 1433]
and Server name is <computerName>\<instanceName>
:
and running
sqlcmd -S . -q "select @@servername"
should output the named instance name.
Upvotes: 1