Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Problem after changing PC name


Problem after changing PC name

Author
Message
Joy Smith San
Joy Smith San
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2083 Visits: 3198
Dear All,

One of our client changed machine name after installing SQL Server.I was able to login to SQL server as usual and SQL servername (same as machine name)was displayed in the object explorer as well.I created a DSN and even that was connecting without any problem.

Problem happend when I executed one of my ASP file, which inserts data into a table using the above mentioned DSN. Got error saying "Could not fine "SERVER NAME" in sys.servers.

When I query "Select @@servername" I got someother name (must be the OLD machine name).But in object explorer it was showing differently. Why so.?

How was I able to login with the server name which was not there in "sys.servers".?




Thanks.
alpeshpradhan
alpeshpradhan
Grasshopper
Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)

Group: General Forum Members
Points: 14 Visits: 199
you login using your old server name OR new server name? OR local host (.)
and which mode you using for login SA/windows?
Chand00
Chand00
Mr or Mrs. 500
Mr or Mrs. 500 (532 reputation)Mr or Mrs. 500 (532 reputation)Mr or Mrs. 500 (532 reputation)Mr or Mrs. 500 (532 reputation)Mr or Mrs. 500 (532 reputation)Mr or Mrs. 500 (532 reputation)Mr or Mrs. 500 (532 reputation)Mr or Mrs. 500 (532 reputation)

Group: General Forum Members
Points: 532 Visits: 1248
Hi,

Whenever a system in renamed at the o/s it has to be renamed at the sql server level also. Try following steps. Login into the sql server system and try this.

If it is a default instance

sp_dropserver
GO
sp_addserver , local
GO

If it is a named instance

sp_dropserver
GO
sp_addserver , local
GO

and restart the sql server services and check out

SELECT @@SERVERNAME AS 'Server Name'

Thanks
Chandra Mohan

alpeshpradhan
alpeshpradhan
Grasshopper
Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)

Group: General Forum Members
Points: 14 Visits: 199
you was able to login because, you must be having alias created using your server IP and old server name.
If you remove that alias then you wont be able to login using your old server name.

check this.
binko
binko
Valued Member
Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)

Group: General Forum Members
Points: 70 Visits: 423
@Chandu, I'm pretty sure the code will throw an error message.

From BOL syntax for dropserver: sp_dropserver [ @server = ] 'server'
[ , [ @droplogins = ] { 'droplogins' | NULL} ]

It looks like you need to use old server name.
@OP:
select @@servername will show you current server name, copy that and replace 'server' in the following with the output:


sp_dropserver 'old_server'
GO
sp_addserver 'new_server', local
GO
exec sp_helpserver


Chand00
Chand00
Mr or Mrs. 500
Mr or Mrs. 500 (532 reputation)Mr or Mrs. 500 (532 reputation)Mr or Mrs. 500 (532 reputation)Mr or Mrs. 500 (532 reputation)Mr or Mrs. 500 (532 reputation)Mr or Mrs. 500 (532 reputation)Mr or Mrs. 500 (532 reputation)Mr or Mrs. 500 (532 reputation)

Group: General Forum Members
Points: 532 Visits: 1248
Hi Binko,

Thanks for the correction. I had missed the servername in dropserver.

Thanks
Chandra Mohan

Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search