我有来自2个不同数据库的数据,我需要对其进行合并和相互比较。
一个例子:
select distinct CustomerNo from DB1.dbo.TableCustomers
UNION ALL
select distinct CustNo from DB2.dbo.NewTableCustomers
我得到在UNION操作中无法解决“ Danish_Norwegian_CI_AS”和“ Danish_Greenlandic_100_CI_AS”之间的排序规则冲突错误。 任何想法如何解决这个问题?
答案 0 :(得分:0)
尝试一下:
select distinct CustomerNo collate Danish_Norwegian_CI_AS from DB1.dbo.TableCustomers
UNION ALL
select distinct CustNo from DB2.dbo.NewTableCustomers