question

tombiernacki avatar image
tombiernacki asked

Update table column between linked servers

Hi I am trying to update a column on a table to = another table column that is inner joined from a linked server database. this is update statement that works if the two databases were on the same server ...... update T..AP_Payments_IxSI set idxT009 = VEN_CLASS from A..APPAYMENT inner join AP_Payments_IxSI on LTRIM(RTRIM( TRANS_NBR))COLLATE SQL_Latin1_General_CP1_CI_AS = idxT001 How can I make this work if `T..AP_Payments_IxSI` is on a linked server. Thanks in advance
updatelinked-server
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
sqlaj 1 avatar image
sqlaj 1 answered
Try adding the servername in front of the table name. Servername.databasename.schemaname.tablename update Servername.T..AP_Payments_IxSI set idxT009 = VEN_CLASS from A..APPAYMENT inner join AP_Payments_IxSI on LTRIM(RTRIM( TRANS_NBR))COLLATE SQL_Latin1_General_CP1_CI_AS = idxT001
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.