Link to home
Start Free TrialLog in
Avatar of anushahanna
anushahannaFlag for United States of America

asked on

SERVERPROPERTY('SERVERNAME') & @@SERVERNAME

Even though both these come from the SQL installation, they are different. How could that have happened?

Are they looking at 2 diff source, even though they are derived from the installation?

Thanks
Avatar of chapmandew
chapmandew
Flag of United States of America image

you're getting 2 different values?  what are you getting?
ASKER CERTIFIED SOLUTION
Avatar of Rich Weissler
Rich Weissler

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of anushahanna

ASKER

select SERVERPROPERTY('SERVERNAME') is JMRW185422
select @@SERVERNAME is CO6849B546
select SERVERPROPERTY('SERVERNAME')  corresponds correctly to the machine name and the default instance also.
renamed the server recently?
renamed the server recently?

no.. just seen it lately.. so no workable issues with it...
Have you changed computer name after the install
I had not; at least after SQL install, computer name was not changed.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
just to change @@SERVERNAME?
Avatar of Rich Weissler
Rich Weissler

*confused*  Sorry, didn't realize this was still under discussion:

What happens if you execute:
sp_addserver 'local'
and then compare?
Thanks Razmus,
just to confirm

with the current state being:
select SERVERPROPERTY('SERVERNAME') is JMRW185422
select @@SERVERNAME is CO6849B546

you recommend the foll:
sp_addserver 'local'
to see if the 2 results will sync up?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I ran sp_addserver 'local'

still
select SERVERPROPERTY('SERVERNAME') is JMRW185422
select @@SERVERNAME is CO6849B546

should i restart the services?