Create or delete a server alias for use by a client
Applies to: SQL Server
SQL Server 2022 and later versions
The SQL Server Native Client (often abbreviated SNAC) has been removed from SQL Server 2022 (16.x) and SQL Server Management Studio 19 (SSMS). The SQL Server Native Client (SQLNCLI or SQLNCLI11) and the legacy Microsoft OLE DB Provider for SQL Server (SQLOLEDB) are not recommended for new application development. Switch to the new Microsoft OLE DB Driver (MSOLEDBSQL) for SQL Server or the latest Microsoft ODBC Driver for SQL Server going forward. For SQLNCLI that ships as a component of SQL Server Database Engine (versions 2012 through 2019), see this Support Lifecycle exception.
For creating or removing an alias for SQL Server 2022 (16.x) and later versions, use cliconfg.exe. For more information, see How to add a network library configuration (Client Network Utility).
SQL Server 2019 and previous versions
This article describes how to create or delete a server alias in SQL Server by using SQL Server Configuration Manager, for SQL Server 2019 (15.x) and previous versions.
An alias is an alternate name that can be used to make a connection. The alias encapsulates the required elements of a connection string, and exposes them with a name chosen by the user. Aliases can be used with any client application. By creating server aliases, your client computer can connect to multiple servers using different network protocols, without having to specify the protocol and connection details for each one. In addition, you can also have different network protocols enabled all the time, even if you only need to use them occasionally. If you have configured the server to listen on a non-default port number or named pipe, and you have disabled the SQL Server Browser service, create an alias that specifies the new port number or named pipe.
Use SQL Server Configuration Manager
Create an alias
In SQL Server Configuration Manager, expand SQL Server Native Client Configuration, right-click Aliases, and then select New Alias.
In the Alias Name box, type the name of the alias. Client applications use this name when they connect.
In the Server box, type the name or IP address of a server. For a named instance, append the instance name.
In the Protocol box, select the protocol used for this alias. When you select a protocol, it changes the title of the optional properties box to Port No, Pipe Name, or Connection String.
The connection strings described in SQL Server Configuration Manager Help can be useful for programmers who create their own connection strings. To access this information, in the New Alias dialog box, press F1, or select Help.
If a configured alias is connecting to the wrong server or instance, disable and then reenable the associated network protocol. Doing this clears any cached connection information and allows the client to connect correctly.
Delete an alias
In SQL Server Configuration Manager, expand SQL Server Native Client Configuration, and then select Aliases.
In the details pane, right-click the alias that you want to delete, and then select Delete.