Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Problem after changing PC name Expand / Collapse
Author
Message
Posted Thursday, July 30, 2009 4:48 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Monday, August 18, 2014 8:25 AM
Points: 1,519, Visits: 2,550
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.
Post #762275
Posted Thursday, July 30, 2009 5:08 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Yesterday @ 3:50 AM
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?
Post #762285
Posted Thursday, July 30, 2009 5:11 AM


Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Friday, July 25, 2014 12:52 PM
Points: 530, Visits: 1,134
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
Post #762289
Posted Thursday, July 30, 2009 5:27 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Yesterday @ 3:50 AM
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.
Post #762308
Posted Thursday, July 30, 2009 2:37 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Tuesday, March 20, 2012 3:34 PM
Points: 73, 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

Post #762774
Posted Friday, July 31, 2009 4:02 AM


Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Friday, July 25, 2014 12:52 PM
Points: 530, Visits: 1,134
Hi Binko,

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



Thanks
Chandra Mohan
Post #762971
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse