Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/87.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql VBA:将int转换为数据类型numeric的人工溢出_Sql_Sql Server_Vba_Insert Into - Fatal编程技术网

Sql VBA:将int转换为数据类型numeric的人工溢出

Sql VBA:将int转换为数据类型numeric的人工溢出,sql,sql-server,vba,insert-into,Sql,Sql Server,Vba,Insert Into,我正在尝试将数据插入SQL Server 2012中的临时数据库 这是我的数据,使用的数据类型为: 1234ab nchar(25) NOT NULL primary key 240 smallint 4535ab nchar(10) 04/01/2013 date 58f658 nchar(6) 584g6555 nchar(9) Insufficient Data text 10 tinyint N/A nchar(5) N/A n

我正在尝试将数据插入SQL Server 2012中的临时数据库

这是我的数据,使用的数据类型为:

1234ab  nchar(25) NOT NULL primary key
240     smallint
4535ab  nchar(10)
04/01/2013  date
58f658      nchar(6)
584g6555    nchar(9)
Insufficient Data   text
10      tinyint
N/A     nchar(5)
N/A     nchar(5)
4       smallint
N/A     nchar(5)
N/A     nchar(5)
4       smallint
N/A     nchar(5)
N/A     nchar(5)
4       smallint
51651.00    numeric(10,7)
65465.50    numeric(14,10)
65465.00    numeric(10,7)
4845.00     numeric(14,10)
04/01/2013  date
5465.00     numeric(18,3)
5465.00     numeric(18,3)
5546.00     numeric(10,7)
test.html   text
note test   text
导入时,所有非数字数据的周围都有相应的“'”。 (顺便说一句,有些数据类型似乎比需要的大,但这只是测试导入的一个小数据示例)
但我得到了以下错误:

将int转换为数据类型numeric的人工溢出

我只是在使用一个常规的
插入到
语句中。
我已经盯着屏幕看了好一阵子了,所以我可能会把它看一遍。。但我在这里错过了什么?数据似乎并不比域大

顺便说一句,如果你需要更多的信息,请让我知道

51651.00数字(10,7)

“数字(10,7)”表示总共10位数字,其中7位位于小数点右侧。这并没有给“51651”留下足够的小数点左边的空间

不同的dbms可能会给您提供更多信息的错误消息。这是来自PostgreSQL的

ERROR:   numeric field overflow
DETAIL:  A field with precision 10, scale 7 must round 
         to an absolute value less than 10^3.

您可能想发布您的
INSERT
语句。我认为它是这样工作的(10,7)=10个总数和7个右边的数字,如果使用的话。因此,121234567或1234567,12都将起作用。。但是你的说法(10,7)只允许小数点左边有3个?这不难测试<代码>创建表wibble(n个数字(10,7));插入wibble值(12345.67)