Compare two tables from two different SQL servers

  • Hi,
    I have two SQL servers both running 2014. My objective is to check if a field (Username) in Server A Table tbl_Users exists in Server B Table tbl_Users. If there is a match then append current date to that username in Server B tbl_users.
    I want to create a stored procedure on Server A, which can at some point be scheduled to execute.
    Is it possible to connect to Server B directly from the stored proc on Server A or do I have to look at creating a linked server. We currently don't use linked servers.
    Thanks
  • osxman - Tuesday, March 19, 2019 11:35 AM

    Hi,
    I have two SQL servers both running 2014. My objective is to check if a field (Username) in Server A Table tbl_Users exists in Server B Table tbl_Users. If there is a match then append current date to that username in Server B tbl_users.
    I want to create a stored procedure on Server A, which can at some point be scheduled to execute.
    Is it possible to connect to Server B directly from the stored proc on Server A or do I have to look at creating a linked server. We currently don't use linked servers.
    Thanks

    Take a look at opendatasource which doesn't require a linked server:
    OPENDATASOURCE (Transact-SQL)

    Sue

  • Thanks!

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

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