Linked server Alias?

  • Hi,

    Background

    we are currently maintaining and developing one systems in 4 diffrent countries. Each system is running on their own database server. Each database server has one business system (Our application) and one ERP system. These business and ERP systems talks to each other.

    Problem

    We do have some performance problems since the fact that the ERP system is very CPU consuming, and that affects our other business system.

    Workaround

    We would like to isolate our ERP system from our business system. One way to do this is by adding a new server that holds the ERP system. So that we will end up with 2 database servers for each country.

    In that case we would use linked server as a method to make the systems communicate with each others.

    Problem, we need to have a generic code that works for all servers - otherwise it will end up with a mess of procedures and sourcecode.

    Is there not a way to add a linked server as an Alias, instead of servername?

    Thanks, Joakim

  • You can specify an alias for a linked server.  Select the datasource to be other data source and select the driver for SQL server.

  • Hi,

    Could you explain this a little bit further?

     

    Joakim

  • Instead of the server names, You can use genric names as linked server names, e.g. 

    Define the business linked server on the ERP db server, given the linked server name as something like "BussinessServer"

    Define the ERP linked server on the business db server, given the linked server name as something like "ERPServer"

    In your stored procedures, you can reference ERP server by "ERPServer" in the business server, and reference the business server by "BussinessServer" in the ERP server.

    It's location or server name independant.

     

     

  • Right click Linked Servers and click on New Linked Servers.

    Enter say test(or anything else) as the name of the linked server.

    Under server type, select the option other data source and select Microsoft OLE DB Provider for SQL server

    Enter the name of the server in Data Source

     

  • Great!

    But do I need to connect through a ODBC? Or could I connect directly to the SQL server with an alias? I havent figured out how it suppose to work with out an ODBC.

    Thanks, Joakim

  • You don't have to create an ODBC. Just give you servername in Data Source

  • I got this from someone last week:

    exec sp_addlinkedserver 'ALIAS', ' ', 'SQLOLEDB', 'SOURCE_SERVER_NAME'

    exec sp_addlinkedsrvlogin 'ALIAS',FALSE,'sa','sa','sa_password'

  • Each server needing connection to the new linked server should have its client network utility updated to a common name chosen as a alias and that name used as the linked server's name.  In that way, generic code can be developed.

  • Nilssond is correct. Use client connectivity to define the alias.


    Carl Davis

Viewing 10 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic. Login to reply