Create linked server to two database on the same server

  • Hi,

    How can I create a linkedserver to two differente database on the same server. Here is what I am trying to do but it doesn't work for the seconde one I try.

    EXEC sp_addlinkedserver1

    @server = 'myserver',

    @srvproduct = '' ,

    @datasrc = 'Database1',

    @provider = 'SQLOLEDB',

    @provstr = 'DRIVER=SQL Server;SERVER=myserver';UID=Username;PWD=Password;'

    EXEC sp_addlinkedserver2

    @server = 'myserver',

    @srvproduct = '' ,

    @datasrc = 'Database1',

    @provider = 'SQLOLEDB',

    @provstr = 'DRIVER=SQL Server;SERVER=myserver';UID=Username;PWD=Password;'

  • Never mind, I found the way to do it....:-D

  • Could you please guide how you have created two databases linked server on the same server because First db linked server created without any error but second one giving error as server does not exist ...

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

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