Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When i installed windows i had a typo in the machine name that i corrected from the system's 'Computer Name/Domain Changes' - the workstation is a member of a workgroup not a domain. From everything i can see the renamed machine name is correct.

Shift gears.... I'm importing SQL logins from my remote server to this, my development workstation and have used the script presented here - a script that generates a CREATE statement for each login found. While I was preparing to run this script's output (from the remote box) i needed to change the domain name from the remote to my local's name - so i ran the same script locally (in order to see what SQL things my domain name is.

SQL has the original machine name - the one with the typo. However, the scripts are tossing errors if i try to create logins with that identifier.


But works correctly if i use the updated machine name: CREATE LOGIN [Steve\Admin] FROM WINDOWS WITH DEFAULT_DATABASE = [master]

So the problem is: do i have a problem i need to solve? Somewhere, deep in the guts of SQL Server, it has record of a Domain name that does not exist. Should i find and fix that discrepancy?


share|improve this question
up vote 6 down vote accepted

To check what SQL Server thinks your machine is named, execute the following:


If Server Name returns the typo'd name, you can change it with:

sp_dropserver <old_name>
sp_addserver <new_name>, local

This article on MSDN documents SQL Server renaming quite well.

Edit: Per your comment, much like renaming a Windows computer, you will need to restart the SQL Server service for the changes to take effect.

REM Stop SQL Server
sc stop mssqlserver

REM Wait a little bit, and/or run
sc query mssqlserver
REM will tell you the status of the service.

REM Start SQL Server
sc start mssqlserver

You can also stop/start SQL Server from within SSMS.

share|improve this answer
much appreciated - the commands executed without error, but initially, the new name didn't show up until after restarting. suggest editing your reply to include that. again...thx – justSteve Dec 24 '10 at 15:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.