如何将 MS SQL XML 字段迁移到 MySQL

发布于 2024-11-03 01:22:29 字数 149 浏览 9 评论 0原文

我在 MSSQL 中有一个 XML 字段类型,我想将它们迁移到 MySQL 5,目前所有其他字段都可以使用 MySQL Migration Toolkit 正常运行,但是这个 XML 字段不处理。

有什么建议吗?谢谢

I have a field type of XML in MSSQL and I would like to migrate them to MySQL 5, currently all other fields are running fine with MySQL Migration Toolkit, but this XML field is not handled.

Any suggestions? Thanks

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

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

发布评论

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

评论(2

聚集的泪 2024-11-10 01:22:29

如果您不需要 XML 类型为您提供的额外功能(检查格式良好的 XML、架构支持等),只需将 XML 文本存储在 LONGTEXT 中>

If you don't need the extra features that the XML type gives you (checking for well-formed XML, schema support etc), the just store the XML text in a LONGTEXT

姜生凉生 2024-11-10 01:22:29

有一些关于 LONGTEXT 与 VARCHAR 优点的有趣页面。例如

长文本或 Varchar

在较新的 MYSQL 版本中(5.0 之后) 3) 对于可以安全预测小于 64k 的字段大小,VARCHAR 是首选。虽然许多 XML 文档可能比这长,但它值得考虑。 5.0.3 和之前的版本将 VARCHAR 限制为 0-255,因此 TEXT 类型几乎肯定是更可取的。

关于 BLOB 类型(包括 TEXT 类型)的详细讨论可以在这里找到:

MYSQL 5.1 参考手册,10.4.3 Blob 和文本类型

我想 MEDIUMTEXT 类型(最多 16Mb)足以满足除最详细的 XML 文档之外的所有文档) -通过 LONGTEXT,为每个记录节省一个字节。

There are some interesting pages regarding the benefits of LONGTEXT vs VARCHAR. e.g.

Long text or Varchar

In newer MYSQL builds (after 5.0.3) VARCHAR is much preferred for field sizes you can safely predict will be less than 64k. While many XML documents may be longer than this, its worth consideration. 5.0.3 and prior builds restrict VARCHAR to 0-255 and so a TEXT type is almost certainly preferable.

A good discussion of the BLOB types (including TEXT types) can be found here:

MYSQL 5.1 reference manual, 10.4.3 The Blob and Text Types

I imagine a MEDIUMTEXT type (up to 16Mb) will suffice for all but the most verbose XML documents) - saving you a solitary byte per record over LONGTEXT.

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