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
                            );  

1 Answer 1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.