SQL Server Express 的 SQL 代理/别名 [英] SQL proxy/alias for SQL Server Express
问题描述
我找不到我需要的东西,或者我不知道要搜索什么.因为我们是一个大团队,在我们的本地人中有不同的设置,如果有可能以某种方式强制连接字符串在我们本地人之间保持持久.
I can't find what I need or I don't know what to search.Because we are a large team with different setup in our locals, if is possible somehow to enforce connection strings to be persistent across our locals.
示例:在配置文件中
<connectionStrings>
<add name="SomeEntities"
connectionString="data source=.\SQLEXPRESS;initial catalog=tests;...rest of it..."/>
</connectionStrings>
就我而言,因为我安装了 SQL DEVELOPER(版本无关),所以我的本地连接将是 "data source=.\;initial catalog=tests;...其余部分..."代码>
As in my case, because I installed SQL DEVELOPER (version is irrelevant) my local connection will be "data source=.\;initial catalog=tests;...rest of it..."
是否可以在 SQL Server 配置管理器中为
指向我的本地
Is it possible to set a proxy in SQL Server Configuration Manager for
<SQLSERVERNAME>\SQLEXPRESS
to point on my local <SQLSERVERNAME>\
我不想安装 SQL Server Express,我想设置一个代理将帮助团队使用 SQLEXPRESS
连接字符串来处理任何已安装 SQL Server 版本.
I'm not looking to install SQL Server Express, I want to setup a PROXY that
will help the team to use SQLEXPRESS
connection string to work on any
installed SQL Server versions.
更新:
根据评论和回复,这是可能的.
Based on comments and responses, it's possible.
先决条件:
- 必须为实例启用 TCP/IP 协议(在我的例子中是端口 1433)
- 进入CMD => netstat -an |find "1433"
SQL SERVER 配置管理器中的设置:
Setup in SQL SERVER Configuration Manger:
感谢您的帮助!
推荐答案
我不知道是不是和实验过的一样服务器实例,我们决定在connectionstring中设置一个标准名称,大家在SQL Server配置管理器里面配置了一个别名,步骤是:
I am not sure if it is the same case that experimented, but in the past, we had a scenario where every developer was using their own name of MS SQL Server instance, we decided to set a standard name in the connectionstring and everyone has configured an alias inside SQL Server Configuration Manager, the steps are:
- 进入 MS SQL Server 配置管理器.
- 转到 SQL Native Client XX 配置并单击别名
- 创建一个新的别名,在这里您应该使用您在连接字符串中注册的标准名称命名它,在协议集 TCP/IP 中以及稍后在服务器部分中,您应该设置本地实例的当前名称.
之后,您已经完成了上一步,您应该能够通过您在别名中定义的名称连接您的本地实例.
After that, you have completed the previous step you should be able to connect your local instance through the name that you have defined in the alias.
这篇关于SQL Server Express 的 SQL 代理/别名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!