• No results found

Instead, use the following steps to update system metadata that is stored in sys.servers and reported by the system function

N/A
N/A
Protected

Academic year: 2021

Share "Instead, use the following steps to update system metadata that is stored in sys.servers and reported by the system function"

Copied!
5
0
0

Loading.... (view fulltext now)

Full text

(1)

Tech Note 742

Renaming a Computer that Hosts a Stand-Alone SQL Server Instance

All Tech Notes, Tech Alerts and KBCD documents and software are provided "as is" without warranty of any kind. See the Terms of Use for more information. Topic#: 002517

Created: November 2010

Introduction

When you change the name of the computer that is running SQL Server, the new name is recognized during SQL Server startup. You do not have to run Setup again to reset the computer name.

Instead, use the following steps to update system metadata that is stored in sys.servers and reported by the system function @@SERVERNAME.

Application Versions

Windows Server 2008 R2 Microsoft SQL Server 2008 SP1

Updating System Metadata

Update system metadata to reflect computer name changes for remote connections and applications that use @@SERVERNAME, or that query the server name from sys.servers.

Note: The following steps cannot be used to rename an instance of SQL Server. They can be used only to rename the part of the instance name

that corresponds to the computer name.

For example, you can change a computer named VMK6432 that hosts an instance of SQL Server named Instance1 to another name, such as

VMK6432New. However, the SQL Server instance part of the name (Instance1), will remain unchanged. In this example, the \\ComputerName\InstanceName will be changed from \\VMK6432\Instance1 to \\VMK6432New\Instance1.

Before you begin the renaming process, review the following information:

When an instance of SQL Server is part of a SQL Server failover cluster, the computer renaming process differs from a computer that hosts a stand-alone instance.

SQL Server does not support renaming computers that are involved in replication, except when you use log shipping with replication. The secondary computer in log shipping can be renamed if the primary computer is permanently lost. For more information, see Replication and Log Shipping in SQL Books online.

When you rename a computer that is configured to use database mirroring, you must turn off database mirroring before the renaming operation. Then, re-establish database mirroring with the new computer name. Metadata for database mirroring will not be updated automatically to reflect the new computer name. Use the following steps to update system metadata.

(2)

Renaming a Computer that Hosts a Stand-Alone SQL Server Instance

Assumptions

This Tech Note assumes the following:

SQL Server is installed locally as the default instance.

The SQL Server database Engine has accepted the new name. SQL Server 2008 x86 is locally installed.

Windows 2008 R2 is locally installed.

Renaming a SQL Server Database Engine

You can connect to SQL Server by using the new computer name after you have restarted SQL Server. To ensure that @@SERVERNAME returns the updated name of the local server instance, you should complete either of the following procedures. The procedure you use depends on whether you are updating a computer that hosts a default or named instance of SQL Server.

Figure 1 (below) shows that the Host name is correct, but running SELECT @@SERVERNAME AS 'Server Name' returns the old server name. The New Server Name should return VMK6432New.

FIGURE 1: MICROSOFT SQL SERVER MANAGEMENT STUDIO QUERY

(3)

sp_dropserver <old_name>

GO

sp_addserver <new_name>, local GO

To rename a computer that hosts a named instance of SQL Server,

Run the following Stored Procedures:

sp_dropserver <'old_name\instancename'>

GO

sp_addserver <'new_name\instancename'>, local GO

Example

To rename a computer that hosts a default instance of SQL Server

Run the following Stored Procedures (Figure 2 below).

sp_dropserver VMK6432New

GO

sp_addserver VMK6432New, local GO

FIGURE 2: MICROSOFT SQL SERVER MANAGEMENT STUDIO QUERY

(4)

Renaming a Computer that Hosts a Stand-Alone SQL Server Instance

FIGURE 3: SERVER MANAGER SERVICES

As a result of the Host running SELECT @@SERVERNAME AS 'Server Name' statement the current server name is returned (Figure 4 below).

(5)

Tech Notes are published occasionally by Wonderware Technical Support. Publisher: Invensys Systems, Inc., 26561 Rancho Parkway South, Lake Forest, CA 92630. There is also technical

information on our software products at Wonderware Technical Support.

For technical support questions, send an e-mail to [email protected].

Back to top

References

Related documents

Favor you leave and sample policy employees use their job application for absence may take family and produce emails waste company it discusses email etiquette Deviation from

3 Go to SETTING menu to set up appropriate WEIGHTING type, LEVEL RANGE, RESPONSE TIME, or to set the maximum or PEAK HOLD display on (or off), Press ENTER for two seconds to return

The PROMs questionnaire used in the national programme, contains several elements; the EQ-5D measure, which forms the basis for all individual procedure

Responsibility beliefs w ere found to significantly m ediate the relationship between perceived m aternal parenting and OCD sym ptom s and also between anxious

To address the first part of Research Question 1, the relationship between parents’ (n = 58) mindsets (growth or fixed) and children’s behaviors associated with mindsets (i.e.

Todavia, nos anos 1800, essas práticas já não eram vistas com tanta naturalidade, pelos menos pelas instâncias de poder, pois não estava de acordo com uma sociedade que se

Source separation and kerbside collection make it possible to separate about 50% of the mixed waste for energy use and direct half of the waste stream to material recovery

This was done by analyzing the extent to which the sample of Kosovan start-ups consider branding as an important strategy for their businesses, how much of branding they