June 21, 2006 at 3:26 pm
Lets say the db is know by its sysname. How do I change it to be sysname\instance_name in sql 2005?
June 22, 2006 at 5:22 am
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()
[font="Comic Sans MS"]The GrumpyOldDBA[/font]
www.grumpyolddba.co.uk
http://sqlblogcasts.com/blogs/grumpyolddba/
June 22, 2006 at 11:58 pm
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
@kbriankelley
October 3, 2007 at 5:13 am
I have the same problem. I want to rename a named instance. Does anyone know how to do it ? thanks!
October 3, 2007 at 5:53 am
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
October 3, 2007 at 6:35 am
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
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply