本文介绍了我们如何别名连接字符串.config中使用的Sql Server实例名称?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个来自不同群体的开发团队。




  • A组针对Sql Server 2008 R2的本地默认实例开发;

  • B组针对Sql Server 2008 R2的本地命名实例开发。



有没有办法设置一个别名,以便两个组都使用相同的名称进行编码?因为现在我们有一个连接字符串的战争,因为组B更改(本地)到 ./ DEV ,组A再次更改?

解决方案

在SQL Server配置管理器中,在SQL服务器本机客户端配置部分下有一个名为别名的小节,您可以在这里添加一个别名到你的命名实例。您只需使用别名,就像它是具有别名的服务器上的默认实例一样。我们使用这个确切的模型,只有一个连接字符串指向一个标准的别名。每个开发人员都有与他们自己的实例相同的别名。


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?

解决方案

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.

这篇关于我们如何别名连接字符串.config中使用的Sql Server实例名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-03 07:51