You must Sign In to post a response.
  • Category: ASP.NET

    Replacing DB server name by its Alias Name

    Hi All,

    In of web application we need to replace original DB server name by its Alias name.

    original connection string -
    <add key="DB-LCTSpitalArzt" value="DBSystem=SQL; Data Source=dedbs0157.aaa.bbb.ccc,1282; Database=CHZD; User ID=admin; Password=dddddd;" />

    Is this ok if we replace only data source(dedbs0157.aaa.bbb.ccc,1282;) by its alias name (xxx.yy.zz,1282;) ??????

    or do we need to replace anywhere else?
  • #766603
    Hi,

    I don't have real time experience in the same, as per my search in Google, I suggest you to go through the below link, here they describe in which scenario this could be helpful to you, and which scenario it gives trouble everything they had discussed, please go through below link.

    https://sqlstudies.com/2014/06/18/aliasing-a-sql-server-when-it-works-when-it-doesnt-and-when-it-may-be-your-problem/

    --------------------------------------------------------------------------------
    Give respect to your work, Instead of trying to impress your boss.

    N@veen
    Blog : http://naveens-dotnet.blogspot.in/

  • #766605
    Alias name is nothing but giving name SQL Server. For ex, Let us consider one server of name "Earth". We all are using the database from Earth. So we are using the database connection string as follows.

    <add key="DB-LCTSpitalArzt" value="DBSystem=SQL; Data Source=Earth; Database=CHZD; User ID=admin; Password=dddddd;" />

    Let us consider many of the applications point to earth. In some issues in server so we are going to move the server into another system "Mars" and down the server "Earth". Now all the connection applications will down because the DB server not available.

    To avoid this kind of issues. we are always creating the "Alies" for SQL server. If we name the alies name something like "DBAppServe". Even though we move the database, if we create alies name in the new server. The application will not down.

    Yes in your case change "Data Source" and check it.

    By Nathan
    Direction is important than speed

  • #766631
    Hi,

    Kindly check below mentioned Link. It may help u..

    1.https://blogs.msdn.microsoft.com/sowmyancs/2012/08/06/install-configure-sharepoint-2013-with-sql-client-alias/

  • #766641
    I doubt alias name will work. I didn't try it my own. If it all you have to change then this is the only place to change from applicatin percepective.

    The reason why I have a doubt on aliase name is, your application always check for the data source and that even from an external source. Normally alias will work within the server.

    Anyway try it from your side and let us know if it works or not.


    Regards,
    Asheej T K
    Microsoft MVP[ASP.NET/IIS]
    DotNetSpider MVM

  • #766654
    Hi All,
    One way is replacing Datasource by new server name(Alias).As back end alias name is connected to original db server.

    2nd way..
    Adding below piece of code in web.config file. will it work?????
    <dsncollection>
    <dsn alias="alias1" name="name1" host="server1.net1.com" port="50001"/>
    <!-- Long aliases are supported -->
    <dsn alias="longaliasname2" name="name2" host="server2.net1.com"
    port="55551">
    <parameter name="Authentication" value="Client"/> </dsn> </dsncollection>

  • #766655
    <dsncollection>
    <dsn alias="alias1" name="name1" host="server1.net1.com" port="50001"/>
    <!-- Long aliases are supported -->
    <dsn alias="longaliasname2" name="name2" host="server2.net1.com"
    port="55551">
    <parameter name="Authentication" value="Client"/> </dsn> </dsncollection>


Sign In to post your comments