Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

hello, if my computer name is x

Status
Not open for further replies.

Jones25

Programmer
Jul 19, 2004
4
CA
hello,

if my computer name is x and sql server was installed and therefore took on the default name of x, can I change the sql server name to y at a later date while the computer name remains as x? If so how do I do it?

The sp_addserver is internal recognition. But I want to connect to sql server using the new name y.
I am assuming setup needs to be run only if computer name also changes to y and this is not the case.

Any help is appreciated.



 
Additional Information.

I am usig SQL Server 7.0, which does not cater for instances.

Thanks in advance for any advise.
 
The SQL Server FAQ by Neil Pike says, "With SQL 7.0 you will need to re-run setup to reset the server name. Setup will detect the name conflict, resolve it, and then finish." Terry L. Broadbent - DBA
Computing Links:
faq183-874 contains "Suggestions for Getting Quick and Appropriate Answers" to your questions.
 
Thanks.

But my scenario is different as I trying to change the sql server name rather than the server name.

Any advise?
 
It is from I think it may be useful to u.
If you are running SQL Server 7.0, after renaming the SQL Server machine, the SQL Server service will fail to start, with an error message "Your installation was corrupted or had been tampered with. To get around this problem, you have to rerun the SQL Server setup. Setup will prompt you to upgrade. After doing so, the necessary SQL Server registry entries will be reset with the new computer name. Now you will be able to start SQL Server. After restarting, use Query Analyzer to run the following commands:

EXEC sp_dropserver 'Your_OLD_Computer_Name'
GO

EXEC sp_addserver 'Your_NEW_Computer_Name', 'local'
GO

Restart your SQL Server service. Connect using Query Analyzer and run the following command (It should output the new server name):

SELECT @@SERVERNAME
GO

If you are running SQL Server 2000, the new name is recognized, the next time SQL Server service starts. You don't have to rerun the setup. However, you have to run the sp_dropserver and sp_addserver stored procedure as shown above.

P.Madhana Gopal,
Principal Software Engineer,
LCube Innovative Solns. Pvt. Ltd.,
India.
 
You all seem to be missing what jones25 is trying to do:

He has a computer (let's say it's named Xray), he loaded SQL Server on it and the instance took the default name of the computer (Xray). He wants to change the INSTANCE name NOT the computer name (let's say to Yankee).

So...

Computer name is Xray and needs to stay that way
SQL Server instance name is Xray and needs to become Yankee.

I don't know SQL 7 (I started with 2000) so I can't help.

-SQLBill
 
Sorry I missed the point of the question. You can use sp_dropserver and sp_addserver to change the name. See the entry for sp_addserver in SQL 7 BOL. I've extracted one paragraph of interest.

LOCAL
Specifies whether the server that is being added is a local or remote server. @local is varchar(10), with a default of NULL. Specifying @local as LOCAL defines @server as the name of the local server and causes the @@SERVERNAME function to return server. (The Setup program sets this variable to the computer name during installation. It is recommended that the name not be changed. By default, the computer name is the way users connect to SQL Server without requiring additional configuration.) The local definition takes effect only after the server is shut down and restarted. Only one local server can be defined in each server.

Note the highlighted caution. We've never changed the defualt name so I don't know how doing so impacts client connections. Perhaps someone who has changed the name can tell what additional configuration is required to connect. Terry L. Broadbent - DBA
Computing Links:
faq183-874 contains "Suggestions for Getting Quick and Appropriate Answers" to your questions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top