Solved

Change SQLSERVER Instance name

Posted on 2014-12-02
6
96 Views
Last Modified: 2015-05-23
Hi I have Cloned Windows VM Server: A and Named as Server: B, Later I changed the OS Hostname from A to B.

Now I required to rename the SQL Server instance name from A to B.

I did rename by using sp_dropserver & sp_addserver, but could not login after rename from A to B.

Need help to rename the SQL Server instance from A to B
0
Comment
Question by:nssasikumar
  • 3
  • 2
6 Comments
 
LVL 25

Expert Comment

by:SStory
ID: 40476681
You can rename host name of instance like follows:
sp_dropserver '<oldservername>'
go

sp_addserver '<newservername>', local
go

Now restart the SQL Server related services. Then, run @@servername to verify if the new name has been updated.
select @@servername
(source: http://www.sqltechnet.com/2012/09/how-to-rename-sql-server-instance.html)
0
 
LVL 46

Expert Comment

by:Vitor Montalvão
ID: 40478033
How did you rename the SQL Server instance and what's the error now?
0
 

Author Comment

by:nssasikumar
ID: 40783115
I have tried the Steps, mentioned above but faced some issues, So I fall back to Old Hostname
0
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
LVL 46

Expert Comment

by:Vitor Montalvão
ID: 40783125
If it's a default MSSQL instance you shouldn't have any kind of problem renaming it.
But if it's a named instance you just can't. You'll need to uninstall the old instance and install a new one.
0
 

Author Comment

by:nssasikumar
ID: 40783146
It means after Host renaming at OS level, the SQLServer Default Instance will be auto renamed as Per New OS hostname?
0
 
LVL 46

Accepted Solution

by:
Vitor Montalvão earned 500 total points
ID: 40783171
SQLServer Default Instance will be auto renamed
No auto renamed. Default instances aren't named so you just need to drop the entry from the old server and add a new entry for the new server:
sp_dropserver '<oldservername>'
 go

 sp_addserver '<newservername>', local
 go

Open in new window

Don't forget to restart the SQL Server so it can use the new server name.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now