SSIS OLEDB COMMAND RULES

本文探讨了在使用OLEDB时出现的参数类型转换错误问题,特别是在使用Charindex函数结合大于0条件时导致的整数类型误用。文章还提到了尝试手动更改参数类型但被系统自动还原的情况,并指出了在MSDN文档中对此行为的解释。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

The oledb commad transformation prepare the wrong data type for the parameter.

With my test, I have known something about the rule. You write query like

Charindex(fileld_name,?)>0 the it will employee a inteter for you because the >0.

If you use cast(charindex(field_name,?)>0 as varchar(255))='0' it will use a DT_STR

With a length of 1. Just for your '0'.

At first I want to change the data type by myself, but it will change back automatically.

After I check this in MSDN, I know that you can not change the Param_x 's name and data type.

You can treat it a bug, but It is hard to check the right data type, so you should take care

For its this character.

I do this in BIDS 2008, Mabe it is ok for 2012 or 2014 CTP.

 

[OLEDB_UPDATE SRVR_DN [20]] Error: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80040E21.

An OLE DB record is available. Source: "Microsoft OLE DB Provider for SQL Server" Hresult: 0x80040E21 Description:

"Invalid character value for cast specification.".

   

   

   

转载于:https://www.cnblogs.com/huaxiaoyao/p/3357896.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值