同一数据库内的归类冲突

问题描述 投票:1回答:1

我对两个查询执行联合。简化版如下所示:

select * from Audit.dbo.PolicyList_t pl
union
select * from Audit.dbo.PolicyList_CurrencyFlip_t pl

两个表都在同一个数据库中。但是,出现以下错误:

Cannot resolve the collation conflict between "Latin1_General_CI_AS" and "SQL_Latin1_General_CP1_CI_AS" in the UNION operation.

我希望在不同数据库上操作而不是查询同一数据库中的两个表时出现排序错误。

我检查了两个表的属性,在两种情况下,归类均为Latin1_General_CI_AS。但是,当两个都选择地址相同的表时,我不会收到任何错误。显然,当单独运行时,两者都选择工作。

我正在使用SQL Server。有什么建议可能是问题的根源吗?

sql sql-server union collate
1个回答
1
投票
您可能会发现this question关于将所有列设置为相同的排序规则很有用。
© www.soinside.com 2019 - 2024. All rights reserved.