How to change the Microsoft SQL Server Name after renaming the computer

by Klaus Graefensteiner 6. September 2011 04:19

Introduction

Renaming a computer that has SQL Server installed can be a little bit tricky and might cause some subtle bugs in software that relies on the name of the SQL Server instance it is connect to. This blog post shows how to change the SQL Server name after a rename of the computer that SQL Server is running on.

photo

Figure 1: Major clean-up after renaming your computer

TSQL commands

There are basically just a few commands that clean up the mess:

Here are the commands as screenshot:

Changing The SQL Server Name after renaming the Computer

Figure 2: Clean up commands in action

Here are the commands as text:

use master

select @@ServerName

EXEC sp_dropserver @server = 'EMINLLNLLNS'

EXEC sp_addserver @server = 'WNDSNLLNLLZW', @local = 'local'

That's it for this short blog post.

Tags: , , , , , ,

SQL | Tips & Tricks | How To

Comments

Comments are closed

About Klaus Graefensteiner

I like the programming of machines.

Add to Google Reader or Homepage

LinkedIn FacebookTwitter View Klaus Graefensteiner's profile on Technorati
Klaus Graefensteiner

Klaus Graefensteiner
works as Developer In Test and is founder of the PowerShell Unit Testing Framework PSUnit. More...

Open Source Projects

PSUnit is a Unit Testing framwork for PowerShell. It is designed for simplicity and hosted by Codeplex.
BlogShell is The tool for lazy developers who like to automate the composition of blog content during the writing of a blog post. It is hosted by CodePlex.

Administration

About

Powered by:
BlogEngine.Net
Version: 1.6.1.0

License:
Creative Commons License

Copyright:
© Copyright 2012, Klaus Graefensteiner.

Disclaimer:
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

Theme design:
This blog theme was designed and is copyrighted 2012 by Klaus Graefensteiner

Rendertime:
Page rendered at 2/22/2012 1:57:29 PM (PST Pacific Standard Time UTC DST -7)