![]() |
|
|
By: Jugal Shah | Read Comments (3) | Print Jugal has 8+ years of extensive SQL Server experience and has worked on SQL Server 2000, 2005, 2008 and 2008 R2. Related Tips: More |
|
In this tip we look at the steps within SQL Server you need to follow if you change the physical server name for a standalone SQL Server.
As you may know, the internal SQL Server name is based on the physical server name, but changing the physical server name does not update the metadata within SQL Server.
When connecting to SQL Server, we use the physical server name for the default instance and physical server name\INSTANCE Name for a named instance. If you change the physical server name, there is no need to re-install SQL Server to reset the physical server name. You can follow the below steps to update the SQL Server system metadata which stores the physical server name in sys.servers.
The below solution works for default and named SQL instances on a standalone machine (non-clustered). Also, you need to follow the steps for each SQL Server instance on the machine.
Msg 15190, Level 16, State 1, Procedure sp_dropserver, Line 56 There are still remote logins or linked logins for the server 'sqldbpool'.
-- Query to check remote login select srl.remote_name as RemoteLoginName, sss.srvname from sys.remote_logins srl join sys.sysservers sss on srl.server_id = sss.srvid -- Query to remove the remote login --Default Instance sp_dropremotelogin old_physical_server_name GO --Named Instance sp_dropremotelogin 'old_physical_server_name\instancename' GO
Msg 15185, Level 16, State 1, Procedure sp_dropremotelogin, Line 68 There is no remote user '(null)' mapped to local user '(null)' from the remote server 'sqldbpool'.
-- Query to check if the SQL Instance databases are involved in replication select name,is_published,is_subscribed,is_distributor from sys.databases where is_published = 1 or is_subscribed =1 or is_distributor = 1 GO

--Query to find out the databases involved in DB mirroring select database_id, db_name(database_id) from sys.database_mirroring where mirroring_guid is not null --Query to turn off the database mirroring ALTER DATABASE SET PARTNER OFF
-- for a Default Instance sp_dropserverGO sp_addserver , local GO --for a Named Instance sp_dropserver <'old_physical_server_name\instancename'> GO sp_addserver <'new_name\instancename'>, local GO
SELECT @@SERVERNAME
sp_addremotelogin [ @remoteserver = ] 'remoteserver'
[ , [ @loginame = ] 'login' ]
[ , [ @remotename = ] 'remote_name' ]

| Share: | Share | Tweet |
|
![]() |
![]() |
Free SQL Server Learning |
| Friday, November 25, 2011 - 1:36:15 AM - chintan parekh | Read The Tip |
|
Nice Article, really helpful. thanx..:) |
|
| Friday, November 25, 2011 - 10:04:10 AM - ihar | Read The Tip |
|
Thanks a lot!!! Easy and useful. |
|
| Tuesday, May 22, 2012 - 7:40:19 PM - sqlq | Read The Tip |
|
hello, I see in my rsreportserver.config the <UrlRoot> </UrlRoot> is empty, the same as <ReportServerUrl> For my case , we have both reporting service and database engine that hosts report databases on the same server. We changed the physical computer name, then I changed the sql server name by using sp_dropserver and addserver. The step I am missing is next step after above changes. If you can tell me next step, that would be helpful. I see empty string <UrlRoot> , and reportserverURl |
|
|
privacy | disclaimer | copyright | advertise | about authors | contribute | feedback | giveaways | user groups Some names and products listed are the registered trademarks of their respective owners. Edgewood Solutions LLC | MSSharePointTips.com | MSSQLTips.com |