Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Machine Name Change Expand / Collapse
Author
Message
Posted Thursday, December 20, 2007 6:02 AM


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: Today @ 1:01 PM
Points: 15,558, Visits: 27,932
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 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans

Product Evangelist for Red Gate Software
Post #435160
Posted Thursday, December 20, 2007 6:51 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: Administrators
Last Login: Today @ 5:13 PM
Points: 33,100, Visits: 15,210
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
Post #435176
Posted Thursday, December 20, 2007 6:54 AM


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: Today @ 1:01 PM
Points: 15,558, Visits: 27,932
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 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans

Product Evangelist for Red Gate Software
Post #435179
Posted Thursday, December 20, 2007 7:05 AM


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: Today @ 1:01 PM
Points: 15,558, Visits: 27,932
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 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans

Product Evangelist for Red Gate Software
Post #435188
Posted Thursday, December 20, 2007 7:26 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, July 23, 2014 5:37 PM
Points: 166, Visits: 57
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
Post #435197
Posted Friday, December 21, 2007 7:13 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Sunday, October 20, 2013 7:52 PM
Points: 1,310, Visits: 483
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.



Post #435623
Posted Friday, December 21, 2007 8:31 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, January 22, 2014 7:25 AM
Points: 23, Visits: 276
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.



Post #435670
Posted Wednesday, January 16, 2008 11:36 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Friday, May 11, 2012 8:22 AM
Points: 23, 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.
Post #443888
Posted Wednesday, January 16, 2008 12:01 PM


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: Today @ 1:01 PM
Points: 15,558, Visits: 27,932
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 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans

Product Evangelist for Red Gate Software
Post #443910
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse