SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Machine Name Change


Machine Name Change

Author
Message
Grant Fritchey
Grant Fritchey
SSC Guru
SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)

Group: General Forum Members
Points: 97939 Visits: 33014
I'm grossly ignorant of SQL Express, so please excuse me if this is obvious.

If you change the machine name in SQL Server, the server, you will, in all likelihood have to reinstall the server. According to our support people, if they change the machine name with MSDE, they have to reimage the machine to get the database back online. The question is, does the same thing happen with SQL Express? If so, is there a good way to work around it, or does it require you to basically reinstall?

Thanks for any help.

----------------------------------------------------
The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood...
Theodore Roosevelt

The Scary DBA
Author of: SQL Server Query Performance Tuning and SQL Server Execution Plans
Product Evangelist for Red Gate Software
Steve Jones
Steve Jones
SSC Guru
SSC Guru (145K reputation)SSC Guru (145K reputation)SSC Guru (145K reputation)SSC Guru (145K reputation)SSC Guru (145K reputation)SSC Guru (145K reputation)SSC Guru (145K reputation)SSC Guru (145K reputation)

Group: Administrators
Points: 145637 Visits: 19425
The sp_dropserver/addserver doesn't work?

I'd be surprised as this is the same codebase as the Workgroup/Standard/Enterprise versions.

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
Grant Fritchey
Grant Fritchey
SSC Guru
SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)

Group: General Forum Members
Points: 97939 Visits: 33014
You're talking to the wrong guy. I'm posting this for our tech support guys. Luckily, I don't have to muck about in Express (yet). I'll try it out & get back to you.

----------------------------------------------------
The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood...
Theodore Roosevelt

The Scary DBA
Author of: SQL Server Query Performance Tuning and SQL Server Execution Plans
Product Evangelist for Red Gate Software
Grant Fritchey
Grant Fritchey
SSC Guru
SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)

Group: General Forum Members
Points: 97939 Visits: 33014
That drops linked servers on a local machine. That's not going to help with Express is it?

----------------------------------------------------
The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood...
Theodore Roosevelt

The Scary DBA
Author of: SQL Server Query Performance Tuning and SQL Server Execution Plans
Product Evangelist for Red Gate Software
Joy Garon
Joy Garon
SSC Veteran
SSC Veteran (228 reputation)SSC Veteran (228 reputation)SSC Veteran (228 reputation)SSC Veteran (228 reputation)SSC Veteran (228 reputation)SSC Veteran (228 reputation)SSC Veteran (228 reputation)SSC Veteran (228 reputation)

Group: General Forum Members
Points: 228 Visits: 70
Actually I just did this yesterday, however, it was on SQL Server 2005 Standard edition. Not sure it applies to Express.
I opened SQL Server Management Studio, created a new query then entered and ran the following:

DECLARE @var1 nvarchar(50)
DECLARE @var2 nvarchar(50)
SET @var1 = convert(nvarchar(50),@@SERVERNAME)
SET @var2 = convert(nvarchar(50),SERVERPROPERTY('MachineName'))
EXEC sp_dropserver @var1
EXEC sp_addserver @var2, local
GO
DonaldW
DonaldW
SSCommitted
SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)

Group: General Forum Members
Points: 1888 Visits: 487
Steve Jones - Editor (12/20/2007)
The sp_dropserver/addserver doesn't work?

I'd be surprised as this is the same codebase as the Workgroup/Standard/Enterprise versions.



I agree. According to BoL the sp_addserver even allows for named instances. I suspect that this also worked with MSDE but I have not tried it myself.



leokarp
leokarp
Valued Member
Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)

Group: General Forum Members
Points: 59 Visits: 299
DonaldW (12/21/2007)
I agree. According to BoL the sp_addserver even allows for named instances. I suspect that this also worked with MSDE but I have not tried it myself.


Proven - it works with MSDE. I did it myself multiple times.



rbarrera
rbarrera
Valued Member
Valued Member (73 reputation)Valued Member (73 reputation)Valued Member (73 reputation)Valued Member (73 reputation)Valued Member (73 reputation)Valued Member (73 reputation)Valued Member (73 reputation)Valued Member (73 reputation)

Group: General Forum Members
Points: 73 Visits: 167
Here is a batch file I wrote:

SC CONFIG SQLBROWSER START= DEMAND

NET START SQLBROWSER

REM THIS WILL UPDATE THE INSTANCE NAME ON A CLIENT, WHERE THE PC NAME HAS BEEN CHANGED AFTER THE INSTALLATION OF SQL

REM YOU SHOULD NOT BE USING DELIMINATORS (- SIGN) IN YOUR PC NAMES!!!! USE (_ UNDERSCORE) INSTEAD, OTHERWISE THIS SCRIPT WILL NOT WORK

%SYSTEMDRIVE% SET

"%ProgramFiles%\Microsoft SQL Server\90\Tools\Binn\SQLCMD" -S "127.0.0.1\(yourinstanceifyouhaveone)" -Q "EXEC sp_dropserver @server = @@servername"

"%ProgramFiles%\Microsoft SQL Server\90\Tools\Binn\SQLCMD" -S "127.0.0.1\(yourinstanceifyouhaveone)" -Q "EXEC sp_addserver %COMPUTERNAME%, 'local'"

REM RESTARTING SERVICES FOR SQL SERVERNAME TO TAKE EFFECT

NET STOP MSSQL$(yourinstanceifyouhaveone) /y

NET STOP SQLSERVERAGENT /y

NET STOP MSSQLSERVER /y

NET START MSSQL$(yourinstanceifyouhaveone)

NET START MSSQLSERVER

NET START SQLSERVERAGENT

REM ADDS A SHORT DELAY FOR SQL TO RESTART

PING 127.0.0.1
PING 127.0.0.1
PING 127.0.0.1
PING 127.0.0.1

NET STOP SQLBROWSER

You may have to modify the code if you're using an instance or not.
Grant Fritchey
Grant Fritchey
SSC Guru
SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)

Group: General Forum Members
Points: 97939 Visits: 33014
Looks good. Thanks.

----------------------------------------------------
The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood...
Theodore Roosevelt

The Scary DBA
Author of: SQL Server Query Performance Tuning and SQL Server Execution Plans
Product Evangelist for Red Gate Software
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search