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

How do I Change The DB\Instance name Expand / Collapse
Author
Message
Posted Wednesday, June 21, 2006 3:26 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, October 31, 2006 2:48 PM
Points: 1, Visits: 1
Lets say the db is know by its sysname. How do I change it to be sysname\instance_name in sql 2005?
Post #289219
Posted Thursday, June 22, 2006 5:22 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Monday, June 9, 2014 6:02 AM
Points: 2,674, Visits: 697

you can rename the database , but a fully qualified database is known by instancename/database name anyway.

select convert(varchar(128),serverproperty('instancename'))

select @@servername

select convert(varchar(128),serverproperty('machinename'))

e.g.

instance102

myserver\instance102

myserver

add to the database name as required e.g.

select convert(varchar(128),serverproperty('instancename'))+'_'+db_name()

 

 



The GrumpyOldDBA
www.grumpyolddba.co.uk
http://sqlblogcasts.com/blogs/grumpyolddba/
Post #289298
Posted Thursday, June 22, 2006 11:58 PM


Keeper of the Duck

Keeper of the Duck

Group: Moderators
Last Login: Yesterday @ 8:57 AM
Points: 6,634, Visits: 1,872
Are you wanting to rename an individual database or the SQL Server itself? If the latter, are you trying to make a default instance a named instance?



K. Brian Kelley, CISA, MCSE, Security+, MVP - SQL Server
Regular Columnist (Security), SQLServerCentral.com
Author of Introduction to SQL Server: Basic Skills for Any SQL Server User
| Professional Development blog | Technical Blog | LinkedIn | Twitter
Post #289589
Posted Wednesday, October 3, 2007 5:13 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, May 29, 2008 4:19 AM
Points: 1, Visits: 9
I have the same problem. I want to rename a named instance. Does anyone know how to do it ? thanks!
Post #406118
Posted Wednesday, October 3, 2007 5:53 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 2:02 PM
Points: 12,916, Visits: 32,076
you cannot rename an instance, it has to be uninstalled and a new instance with the correct name needs to be created. that means backing up non-system databases, and then restoring them in the new instance.

I haven't seen a registry hack or anything that successfully changed an instance name yet.



for example, if you had SERVER\SQL2005 as an instance, and you wanted to rename the \SQL2005 for any reason, you have to uninstall the instance, and add the new one (ie SERVER\DEVELOPER

if you rename the server, it will automatically change to NEWSERVERNAME\SQL2005


Lowell

--There is no spoon, and there's no default ORDER BY in sql server either.
Actually, Common Sense is so rare, it should be considered a Superpower. --my son
Post #406133
Posted Wednesday, October 3, 2007 6:35 AM


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: Today @ 1:03 PM
Points: 15,729, Visits: 28,132
Create the new instance, copy & attach all the databases, drop the old instance.

It is a pain in the tucas.


----------------------------------------------------
"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 #406149
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse