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
Posted Tuesday, April 09, 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: 2 days ago @ 8:24 AM
Points: 1,718, Visits: 1,248
The target table cannot be remote. Here's a link to a previous posting that might be of some use to you.

Yeah, uh huh, you know what it is. Everything I do, I do it big

Post #1440829
Posted Friday, April 12, 2013 1:37 PM



Group: General Forum Members
Last Login: Wednesday, April 16, 2014 9:25 AM
Points: 7,070, Visits: 12,523
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

Believe you can and you're halfway there. --Theodore Roosevelt

Everything Should Be Made as Simple as Possible, But Not Simpler --Albert Einstein

The significant problems we face cannot be solved at the same level of thinking we were at when we created them. --Albert Einstein

1 apple is not exactly 1/8 of 8 apples. Because there are no absolutely identical apples. --Giordy
Post #1441894
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse