如何将 CLOB 从 Oracle 复制到 SQL Server
CLOB 是 XML 数据,> 8k(有时> 32k)。 有什么建议么?
The CLOB is XML data that is > 8k (sometimes > 32k). Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不幸的是,我无法在 SQL Server 中运行它,因此我编写了一个 C# 控制台应用程序来导入和解析 CLOB 数据,然后将结果写入 SQL Server。
Unfortunatly I was unable to run it within SQL Server, so I wrote a C# console application to import and parse the CLOB data, then to write out the results to SQL Server.
您可能必须使用 IMAGE 类型,因为 BINARY 类型在 SQLServer 2K 中限制为 (IIRC) 8000 字节。 SQLServer 2005 中对 varchar 和 varbinary 的限制有所增加,因此这取决于您的目标是什么。 对于 2005 年,如果您的数据是 ASCII,则可以使用 varchar,如果是 unicode 文本,则使用 nvarchar,否则使用 varbinary。
如果您正在寻找示例代码,则必须向我们提供更多信息,例如您使用的语言/平台以及如何访问这两个数据库。 另外,这是一次性传输,还是需要在生产中以编程方式执行的操作?
You may have to use the IMAGE type, as the BINARY type is limited to (IIRC) 8000 bytes in SQLServer 2K. The limits for varchar and varbinary increased in SQLServer 2005, so it depends on what your target is. For 2005, if your data is ASCII varchar will work, if it's unicode text use nvarchar, otherwise use varbinary.
If you're looking for sample code, you'll have to give us more information, like what language/platform you're using, and how you're accessing the two databases. Also, is this a one-time transfer, or something that you need to do programmatically in production?