3

I have a database on a Replication server that doesn't exist on the Primary server.

There are stored procedures on the Replication server's DB that join to tables in other databases on the Replication server. These should be joining to tables on the Primary server.

Is this possible? If so, how?

This is an example of what it's currently doing:

UPDATE  c
SET     CRP_Id      = be.EventId
FROM    #TempEvent be
JOIN        CRP.dbo.Payments c -- *should* be joining to CRP on Primary, not Replication
    ON  c.CRP_TransactionId     = be.SourceTransactionId
WHERE   be.EventTypeId  in  (
                                @MyEventTypeId
                            );  
DaveDev
  • 133
  • 2

1 Answers1

2

You should use linked server and use four part naming linkedservername.dbname.schema.object

Also refer my answer on efficient way of pulling data when using linked server

Kin Shah
  • 62,545
  • 6
  • 124
  • 245