SQL proxy/alias for SQL Server Express

余生颓废 提交于 2019-12-02 02:47:58

问题


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.

Example: In config files

<connectionStrings>
    <add name="SomeEntities" 
         connectionString="data source=.\SQLEXPRESS;initial catalog=tests;...rest of it..."/>
</connectionStrings>

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..."

Is it possible to set a proxy in SQL Server Configuration Manager for <SQLSERVERNAME>\SQLEXPRESS to point on my local <SQLSERVERNAME>\

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.

UPDATE:

Based on comments and responses, it's possible.

Prerequisites:

  • TCP/IP protocol must be enable for the instance (in my case port 1433)
  • To check go in CMD => netstat -an |find "1433"

Setup in SQL SERVER Configuration Manger:

Thank you for the help!


回答1:


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:

  1. Enter MS SQL Server Configuration Manager.
  2. Go to SQL Native Client XX Configuration and click in Aliases
  3. Create a new Alias, here you should name it with the standard name that you have registered inside your connection string, inside the Protocol set TCP/IP and later in Server section, you should set up the current name of your local instance.

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.




回答2:


What are you talking about is called alias:

Create or Delete a Server Alias for Use by a Client

You can create an alias with name SQLSERVERNAME\SQLEXPRESS which will point to localhost and vice versa. Alias should be created on client machine.



来源:https://stackoverflow.com/questions/54178823/sql-proxy-alias-for-sql-server-express

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!