Link to home
Start Free TrialLog in
Avatar of Grand Wavine
Grand WavineFlag for Papua New Guinea

asked on

SQL Server Name Change affecting SQL Database Service

The Server (win 2008) name for one of our test Server was changed , however, the server hosted an SQL Database. with the change, it has resulted in us unable to connect to the SQL Database (sql 2008). the previous username does not work anymore and i even tried connecting with windows authentication and still nothing. is there anyway to resolve this?

Regards,
Grand
Avatar of HainKurt
HainKurt
Flag of Canada image

what is your connection string?
Avatar of Grand Wavine

ASKER

im just trying to connect via the SQL Management Studio on the SQL Server, i tried reverting to the previous name but i still cannot connect
While renaming the SQL Server you should also rename the physical server.
The physical layer is what allows the user to connect using the DNS name. Without changing that name changing the internal reference of SQL Server is meaningless as you would not be able to find the name on the network. You could refer to it still as the old name and could connect with the old name or the IP address.  Attempt to reference the renamed SQL install.

Either change the SQL server back to the original, or rename the physical server on which is resides to match the name that you set SQL server to.
you can browse the servers, select it and connect...
User generated image
Thanks, i did that however, when i did logon via windows authentication all the databases i had previously are not there anymore, does that mean i will have to reattach all the Databases including the views, SP's and SSIS packages?

regards,
Grand
if you login to new db server and dont see the databases, then it means they are not there!
you have to attach all existing ones or create new db and restore from backups...
Avatar of Vitor Montalvão
Renaming a Server should be performed very carefully as it affects the SQL Server instances.
Did you read the correspondent MSDN article about it?
If not then you'll need to perform changes in the SQL Server instance:
sp_dropserver <old_name>;  
GO  
sp_addserver <new_name>, local;  
GO  

Open in new window

Btw, if you didn't change the IP as well there's a chance that you can connect using the IP address and port number.
These 2 statements have to return the same name:


select @@servername                              -- will retuturn old name
select SERVERPROPERTY('servername')      -- will return new name

At least the server name before the \ if is an instance name.
Grand Wavine, a feedback will be appreciated.
Cheers
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.