0

I'm trying to merge tables. Both contain a data type of geometry. Apparently I need a passthrough query to be able to write geometry/geography type to remote server.

MERGE
  [SERVER].[DB].[dbo].[TABLE] AS TR
USING
  #Temptable AS SR
ON
  (TR.ASSET_ID = SR.ASSET_ID)

WHEN MATCHED AND TR.SHAPE <> SR.SHAPE OR TR.VERS <> SR.VERS 
    THEN UPDATE SET
        TR.SHAPE = SR.SHAPE, 
        TR.VERS = SR.VERS

WHEN NOT MATCHED BY TARGET 
    THEN INSERT (ASSET_ID, VERS, SHAPE) 
        VALUES (SR.ASSET_ID, SR.VERS, SR.SHAPE);

Error in SQL I'm getting:

Objects exposing columns with CLR types are not allowed in distributed queries. Please use a pass-through query to access remote object

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.