SQL 2K - Linked Servers - using an alias

  • Is it possible to set up a linked server (to another SQL server) using an alias .

    I have some views that are referencing the fully qualified 4 part name and I would like to be able to switch a linked server from DEV to ROLLOUT to PRODUCTION without having to change the Views.

  • Someone else in another thread suggested something like this

    use Client Network Utility to create an alias (eg LINK1) that points to one of the servers (eg DEV) using the real servername or IP address.

    Use LINK1 in your views

    When you want to link to a different server use Client Network Utility to change the server name / ip address of the server you want

    never tried this myself though

    Far away is close at hand in the images of elsewhere.
    Anon.

  • Excellent - that seems to work fine.

    I've also had an alternative approach :-

    exec sp_addlinkedserver @server='DEV', @srvproduct='', @provider='SQLOLEDB', @datasrc='REALSERVERNAME'

    This works too - modifying the server name in the Linked Server.

Viewing 3 posts - 1 through 2 (of 2 total)

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