views:

41

answers:

1

Hello everyone,

I am using SQL Server 2008 Enterprise DB and using the new Merge statement (when source and target are both SQL Server 2008 DB tables), and it works well. I have another database table which is hosted in SQL Server 2005 Enterprise DB. I want to know whether Merge statement could using one table of SQL Server 2008 as source, and another tableof SQL Server 2005 as target? The two databases may not exist on the same machine.

thanks in advance, George

+2  A: 

No - the merge statement must be able to run on the sql server where you are inserting the records, and your 2005 instance wouldn't know what to do with it.

Ray
You mean both source and target must be running on Sql server 2008? Or target must be on sql server 2008, but source (since source is always read only) could be on sql server 2005?
George2
The merge statement (or any sql statement) can only run within the server instance where the database lives. So, while you may run a query on server A which accesses server B, what actually happens is that server A sends a sql statement to server B which server B must then run against its own database(s). If B is sql 2005, and the statement contains a 'merge', it won't be able to run it.
Ray
Thanks, question answered!
George2