Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do we alias a Sql Server instance name used in a Connection String .config?

I have two development teams, that come from different groups.

  • Group A develops against a local default instance of Sql Server 2008 R2;
  • Group B develops against a local named instance of Sql Server 2008 R2.

Is there a way to setup an alias such that both groups are coding against the same name? As it stands right now we have a war of Connection Strings as group B changes (local) to ./DEV and group A changes it back again?

like image 693
Ralph Shillington Avatar asked Jun 29 '10 11:06

Ralph Shillington


People also ask

What is aliases in SQL Server Configuration Manager?

Aliases (SQL Server Configuration Manager) 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.

How do I set an alias for a named instance?

In SQL Server Configuration Manager, under the SQL server native client configuration section there is a subsection called "aliases" you can add an alias into here that points to your named instance. You just use the alias as if it is the default instance on a server with the name of the alias.

How to create Alias in SQL Server Native Client?

In SQL Server Configuration Manager, expand SQL Server Native Client Configuration, right-click Aliases, and then click New Alias. In the Alias Name box, type the name of the alias.

How do I use an alias in a connection string?

You just use the alias as if it is the default instance on a server with the name of the alias. We use this exact model and have only one connection string that points to a standard alias.


1 Answers

In SQL Server Configuration Manager, under the SQL server native client configuration section there is a subsection called "aliases" you can add an alias into here that points to your named instance. You just use the alias as if it is the default instance on a server with the name of the alias. We use this exact model and have only one connection string that points to a standard alias. Each developer has the same alias name pointing to their own instance.

like image 193
Ben Robinson Avatar answered Oct 23 '22 04:10

Ben Robinson