April 9, 2013 at 11:55 am
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)
April 10, 2013 at 8:12 am
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
April 12, 2013 at 1:37 pm
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
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply