Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Merge Statement One Server to another Expand / Collapse
Author
Message
Posted Tuesday, April 9, 2013 11:55 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Tuesday, February 18, 2014 5:22 PM
Points: 58, Visits: 197
Hello,

I have a requirement where I need to insert/update data from a Table A in SqlServer A to
a Table B of a reporting database in SqlServerB .

Currently, I am using a staging table to achieve my task.

I have used merge statements in the past .. but that was only for running queries within the same
sql server.

I would like to know if a merge statement can be used directly to copy from a database from one
Sql Server and insert/update to a database in another Sql Server. ? ( I am planning to use the merge
statement with ssis)
Post #1440489
Posted Wednesday, April 10, 2013 8:12 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Yesterday @ 2:41 PM
Points: 1,921, Visits: 1,441
The target table cannot be remote. Here's a link to a previous posting that might be of some use to you.

http://www.sqlservercentral.com/Forums/Topic834948-391-1.aspx




Everything is awesome!
Post #1440829
Posted Friday, April 12, 2013 1:37 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 8:51 PM
Points: 7,125, Visits: 12,723
Even if MERGE supported such changes, chances are the source resultset from the MERGE would need to be completely copied to the remote server in order to facilitate. Consider creating a table on the remote server, copying your source resultset into it, and then issuing a MERGE on the remote server using EXEC() AT [LinkedServer].

__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Post #1441894
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse