本文介绍了将Image数据类型转换为Varbinary和Numeric的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello Everyone,

Hello Everyone,

我们的数据来自具有以下结构的应用程序。

We have data coming from an application that has the following structure.

CREATE TABLE [dbo].[PriceQuantity](
	[QUANTITY] [image] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

INSERT INTO [PriceQuantity]
VALUES('0xBDC5C000000000000000000000000000')
GO

而且,我正在尝试以下查询,它会抛出错误。如何将图像数据类型转换为数字?

And, I am trying the following query and it is throwing an error. How do I convert an image datatype to numeric?

SELECT [QUANTITY], CONVERT(NUMERIC(8,4), TRY_CAST([QUANTITY] AS varbinary))
  FROM [dbo].[PriceQuantity]





Msg 8115, Level 16, State 6, Line 2
Arithmetic overflow error converting varbinary to data type numeric.

谢谢!

已知是DROP,Unknown是OCEAN。

Known is a DROP, Unknown is an OCEAN.

推荐答案


这篇关于将Image数据类型转换为Varbinary和Numeric的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-26 01:04