使用链接的服务器数据更新本地表 [英] update local table with linked server data

查看:157
本文介绍了使用链接的服务器数据更新本地表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用链接服务器中的数据更新本地表。 我一直得到"无法解决"SQL_Latin1_General_CP1_CI_AS"之间的整理冲突"和"Latin1_General_CI_AS"在等于操作" 
我已将远程服务器表上的排序规则更改为  SQL_Latin1_General_CP1_CI_AS排序规则,错误仍然出现。

I am trying to update a local table with data from a linked server.  I keep getting "Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Latin1_General_CI_AS" in the equal to operation"  I have changed the collation on the remote server table to SQL_Latin1_General_CP1_CI_AS collation and the error is still appearing.

这是我的查询:

推荐答案

您可以在查询中转换排序规则

You can cast the collation in your query

UPDATE [localDB].[dbo].[LocalTable]
SET    Cost = a.PurchaseCost,
   Price = a.SalesPrice,
   List = a.SalesPrice
FROM   [linkedServer].[linkedDB].[dbo].[linkedTable] as a
WHERE  a.[Name] collate Latin1_General_CI_AS = [localDB].[dbo].[localTable].[LocalField] collate Latin1_General_CI_AS


这篇关于使用链接的服务器数据更新本地表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆