升级到 SQL Server 2005:无法将 QNAN INSERT QNAN 到浮点列中?

发布于 2024-07-12 10:10:08 字数 602 浏览 5 评论 0原文

背景:
我正在努力从 SQL Server 2000 迁移到 SQL Server 2005。这为使用 SQL Native Client 通过 ODBC 与 SQL Server 通信的 C++ 应用程序提供数据库服务。

问题:
我正在尝试将 QNAN 插入数据库中的浮点列中。 在我的应用程序中,该值存储为双精度值(值:1.#QNAN00000000000)并作为参数发送到数据库中。 这在 SQL Server 2000 中不是问题,但相同的代码在 SQL Server 20005 中出现以下错误:

传入的表格数据流 (TDS) 远程过程调用 (RPC) 协议 流不正确。 参数3(“”): 提供的值无效 数据类型 float 的实例。 检查 无效值的源数据。 一个 无效值的示例是以下数据 小数位数大于的数字类型 精度。

问题
是否可以让 SQL Server 2005 接受 QNAN? 如果是这样,怎么办?

Background:
I'm working on migrating from SQL Server 2000 to SQL Server 2005. This is providing DB service for a C++ application that uses SQL Native Client to communicate with SQL Server via ODBC.

Problem:
I'm attempting to insert QNAN into a float column in the database. In my application, this value is stored as a double (value: 1.#QNAN00000000000) and is sent into the database as a parameter. This was not a problem in SQL Server 2000 but the same code gives me the following error in SQL Server 20005:

The incoming tabular data stream (TDS)
remote procedure call (RPC) protocol
stream is incorrect. Parameter 3 (""):
The supplied value is not a valid
instance of data type float. Check the
source data for invalid values. An
example of an invalid value is data of
numeric type with scale greater than
precision.

Question:
Is it possible to get SQL Server 2005 to accept QNAN? If so, how?

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

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

发布评论

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

评论(2

盗梦空间 2024-07-19 10:10:08

根据对此错误报告的响应,SQL Server 2005不接受 NaN 或无穷大,这显然是设计使然(由于排序/比较问题)。

According to the response to this bug report, SQL Server 2005 does not accept NaN or infinity, and this was apparently by design (due to sorting/comparison issues).

甜心小果奶 2024-07-19 10:10:08

sql 2005 不支持 QNAN。NAN 也不支持。

从技术上讲,SQL 2000 也不支持它们。 然而,他们工作了。

您可能需要查看以下内容:

SQL 2005 下的 DATA_PURITY 检查
http://support.microsoft.com/kb/923247

您可能想要访问的另一个地方是:
http://www.mssqltips.com/tip.asp?tip=1119

QNAN's are not supported under sql 2005. Neither are NAN's

Technically speaking they weren't supported under SQL 2000 either. However, they worked.

You might want to review the following:

DATA_PURITY Checks under SQL 2005
http://support.microsoft.com/kb/923247

Another place you might want to visit is:
http://www.mssqltips.com/tip.asp?tip=1119

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