【问题标题】:SSIS 2010 update table with decimal data type gives error "type not supported.DBTYPE_DECIMAL"具有十进制数据类型的 SSIS 2010 更新表给出错误“不支持类型。DBTYPE_DECIMAL”
【发布时间】:2015-12-15 19:50:42
【问题描述】:

奇怪的错误,在 2012 Enterprise Edition db 上使用 SSIS 2010。 使用 OLEDB 连接。

变量 a,b,c 在 ssis 中定义为 Decimal。 d 被定义为一个字符串。

Sql 任务:

Select min(col1),max(col1) from table_a
           where key_value = ?

where: parameter 0 is d , data type=Varchar
         resultset 1 is a , 2 is b

表达任务:

 @[User:c] = (DT_DECIMAL,2) (@[User:a] + @[User:b])

Sql 任务:

Update table_a
set col2 = ?
where key_value = ?

where: parameter 0 is c (DataType=DECIMAL) and 1 is d (DataType=Varchar)

错误:...失败并出现以下错误:“类型不是 支持.DBTYPE_DECIMAL”。可能的失败原因:问题与 查询,“ResultSet”属性设置不正确,参数不正确 设置正确,或未正确建立连接。

table_a 定义为

  d  varchar(4),
    col1 numeric(10,2),
    col2 numeric(10,2)

d 有多行,表上没有索引... 我已经尝试在更新语句中转换和转换值 任何想法有什么错误? 谢谢

【问题讨论】:

    标签: sql-server ssis sql-update


    【解决方案1】:

    检查 SQL 任务的参数映射部分以确保参数设置正确。 我以前见过这个,'参数设置不正确'是关键。

    【讨论】:

      猜你喜欢
      • 2018-10-29
      • 2015-08-04
      • 1970-01-01
      • 1970-01-01
      • 2015-05-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多