How to fix SQL Server when you have changed your computer name

Sure every SQL Server wants to feel special.. But before you take it out on the town and give it a new name and a dinner, and a show.. Just keep in mind the SQL SERVER WILL CRASH AND BURN TO PIECES if you change your machine name..

You see there are tables in your SQL Server that explain what the machine is called that it resides on.. This is kinda important and if SQL Server can’t ‘find itself’ you start hitting all sorts of problems.

Easy enough fix though:

Open a command prompt, type in SQLCMD to get to the SQL Server Command Prompt – as per screenshot below:

SQLCMD from the Command Prompt. Denoted by a tiny little '1>'

Type the following with an enter after each line:

EXEC sp_dropserver ‘oldmachinename’

GO

EXEC sp_addserver ‘newmachinename’,’local’

GO

If you execute these correctly you should be able to restart your SQL Server Services and bickity bam it will be up and running again..

Happy ninjering your SQL Server!

The Ninja..

How to fix SQL Server when you have changed your computer name was last modified: January 28th, 2015 by theninja