将 Oracle 数据(和索引)移至 SQL-Server - 数据大写

发布于 2024-09-24 16:24:20 字数 272 浏览 1 评论 0原文

我正在尝试将数据从 Oracle (10g) 数据库移动到 SQL-Server (2008)。我还希望在 SQL Server 端重新创建索引。然而,在Oracle中,在前两个字段上定义了一个主键,并且它有这样的数据:

VALUE3   FOO4
VALUE4   FOO8
Value4   Foo8

当我将该数据获取到SQL Server时,由于数据重复,它不会创建该索引。 Oracle 考虑了该情况并认为第二条和第三条记录不同。

建议?

I'm trying to move data from an Oracle (10g) database to SQL-Server (2008). I also want the indexes to be re-created on the SQL-Server side. However, in Oracle, there is a primary key defined on the first two fields, and it has data like this:

VALUE3   FOO4
VALUE4   FOO8
Value4   Foo8

When I get that data to SQL Server, it won't make that index, because of duplication of data. Oracle considers the case and thinks the 2nd and 3rd records are different.

Suggestions?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

怂人 2024-10-01 16:24:20

问题在于 SQL Server 上的排序规则。
排序规则不区分大小写,因此它将“VALUE4”和“Value4”视为同一事物。您需要将排序规则更改为区分大小写,以便能够应用主键约束。

您可以阅读有关它的更多信息,以及如何在本文中更改 SQL Server 上的排序规则

The issue is the collation on SQL Server.
The collation is case insensitive, so it sees "VALUE4" and "Value4" as the same thing. You need to change the collation to be case sensitive, in order to be able to apply the primary key constraint.

You can read more about it, and how to change the collation on SQL Server in this article.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文