Connection Problem cause by Change Computer Name

Hi,

I have a server let's say "Server". The connection is doing fine, until some change it to "Server01".

Could we solve this problem by not changing the computer name back ?

Thank you.

LVL 1
emi_sastraAsked:
Who is Participating?
 
pssandhuCommented:
Can you not update your connection string with the new server name?
P.
0
 
emi_sastraAuthor Commented:
Hi pssandhu,

I could recompile my application, not problem with that.
How about the data? It is gone,  I mean how to attach the data to the new instance and the new sql server instance (new computer name) is not there yet.

Thank you.
0
 
pssandhuCommented:
Has the SQL Server instance name changed as well? If all that was done was to change the server name then the defaul or named sql server name will not change.
Are you running into errors when you change your connection string?
P.
0
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

 
emi_sastraAuthor Commented:
-Has the SQL Server instance name changed as well?
Not yet.

Are you running into errors when you change your connection string?
Yes, since there is no database there.

Thank you.
0
 
pssandhuCommented:
<<Yes, since there is no database there.>>
So it's a new server then? If the server was renamed then the database shouldn't disappear or get deleted. If there is no database then either it must be a new server/machine or the target machine has been rebult.
Sorry but I am missing something obvious here?
P.
0
 
emi_sastraAuthor Commented:
-So it's a new server then?
No, it is not.

-If the server was renamed then the database shouldn't disappear or get deleted.
Yes, its still there on HD folder.

Are you running into errors when you change your connection string?
Yes, and I should say since the sql instance name is not the same as the computer name (still "server").

Because the servername = "ComputerName\SQLEXPRESS", when the computer name is changed then will get exception when try to connect it.

Thank you.
0
 
emi_sastraAuthor Commented:
I just tried to rename my computer, restart it.

Now, I can't even use SQL Management to see the database.

Thank you.
0
 
emi_sastraAuthor Commented:
I could access it using browse.
Does it mean that when I change my computer name then the Windows change the sql instance also like:

Server\SQLEXPRESS to Server01\SQLEXPRESS

What I need just recompile my app using Server01\SQLEXPRESS as connection string?

Thank you.
0
 
emi_sastraAuthor Commented:
Hi pssandhu,

I get it now.
I seems like it is new feature of SQL 2005, rename SQL instance automatically when computer name is renamed.
It does not behave like that in SQL 7.

Thanks for the discussion.
0
 
pssandhuCommented:
Oh, cool. I was just testing the theory. Awesome!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.