Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

Merge Statement One Server to another Expand / Collapse
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

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



Group: General Forum Members
Last Login: Friday, December 2, 2016 1:54 PM
Points: 2,212, Visits: 1,688
The target table cannot be remote. Here's a link to a previous posting that might be of some use to you.

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



Group: General Forum Members
Last Login: Today @ 4:14 PM
Points: 7,933, Visits: 14,358
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